Does get_posts() support tax_query? RC4
-
i’m trying to do some custom queries for a 2nd loop and typically I use get_posts so it doesn’t mess with the main query. i am using 3.1 RC4 and was trying to implement some of the new tax_query support.
the following, using query_posts() works as expected.
$myquery['tax_query'] = array( array( 'taxonomy' => 'genre', 'terms' => array('fantasy'), 'field' => 'slug', ), ); $myposts = query_posts( $myquery );however, even though the codex says that get_posts supports all the same arguments as query_posts, get_posts() does not return any values with the same arguments.
$myquery['tax_query'] = array( array( 'taxonomy' => 'genre', 'terms' => array('fantasy'), 'field' => 'slug', ), ); $myposts = get_posts( $myquery );get_posts() does however seem to work if the taxonomy is one of the default WP taxonomies… like a category.
$myquery['tax_query'] = array( array( 'taxonomy' => 'category', 'terms' => array('artists'), 'field' => 'slug', ), ); $myposts = get_posts( $myquery );
Viewing 10 replies - 1 through 10 (of 10 total)
Viewing 10 replies - 1 through 10 (of 10 total)
The topic ‘Does get_posts() support tax_query? RC4’ is closed to new replies.