WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have custom post type (entertainment) and I set up a taxonomy (review) as hierarchal so there are check boxes under the taxonomy. Most of the post in the entertainment are just post but we also have reviews. What I was hoping is that if it's a review then you can just check what type of review in the review taxonomy box, an example is "movie". I am trying to display the latest review using

query_posts( array('tax_query' => array(array('taxonomy' => 'review','field' => 'slug','term' => 'movie')), 'posts_per_page'=>'1', 'caller_get_posts'=>'1') ); 

But it's showing the latest post and not the one selected as movie.

I'm on WP 3.1

share|improve this question
up vote 1 down vote accepted

You can do a straight query for the taxonomy term:

query_posts( array( 'review' => 'movie' ) );

To query multiple terms you can use tax_query:

'tax_query' =>     array(
            'taxonomy' => 'review',
            'field' => 'slug',
            'terms' => array( 'movie', 'term', 'term' ),
share|improve this answer
that worked, I'm always trying to do it more complicated than it should be. Now what if I wanted to check multiple terms? I tried 'review'=>array('term,'term,'term') and that didn't work. – kel Feb 26 '11 at 11:00
@kel see updated answer – Chris_O Feb 26 '11 at 18:53
the second one didn't work for me. – kel Feb 26 '11 at 22:33
I got it now it should be 'tax_query' => array(array( 'taxonomy' => 'review', 'field' => 'slug', 'terms' => array( 'movie', 'term', 'term' )) ), – kel Feb 27 '11 at 7:17

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.