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'm currently creating a website that uses several content types, (e.g. books, movies, shows) as well as a key taxonomy term (e.g. status, with values of owned and wishlist).

My question is, in a custom template how do I create a loop that queries only one taxonomy value across multiple custom post types (i.e. a single list of all of the books, movies and shows on my wishlist.)

The closest I could find was this post Using Query Posts With Multiple Post Types And A Taxonomy

But unfortunately, I am having a hard time making it work as is in my template. And, ideally I'd prefer to use a wp_query instead of get_posts.

share|improve this question
up vote 1 down vote accepted

You can do this with an array of post types and a tax query for your term. The question you linked had special requirements as only one of the post types used the taxonomy.

$args = array(
    'post_type' => array( 'books', 'movies', 'shows' ),
    'posts_per_page' => -1,
    'tax_query' => array(
            'taxonomy' => 'status',
            'field' => 'slug',
            'terms' => 'wishlist'
$wishlist = new WP_Query( $args );
share|improve this answer
Of course I massively overcomplicated that problem. Worked like a charm. Thanks! – Joeykangaroo Mar 15 '13 at 19:16

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.