Created
February 24, 2011 06:56
-
-
Save brandondove/841869 to your computer and use it in GitHub Desktop.
query_posts 3.1 vs 3.0.5 - SQL differences
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
this works, but is it right to separate out the two categories here? I thought I could include both cat ids in the first terms array, but it seems that if I do that, it pulls any post that matches either category instead of both. | |
*/ | |
query_posts( array( | |
'tax_query' => array( | |
'relation' => 'AND', | |
array( | |
'taxonomy' => 'category', | |
'terms' => array( 5629 ), | |
'field' => 'term_id', | |
), | |
array( | |
'taxonomy' => 'category', | |
'terms' => array( 5623 ), | |
'field' => 'term_id' | |
) | |
), | |
'posts_per_page' => -1, | |
'orderby' => 'title', | |
'order' => ASC | |
)); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment