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

So I've created a little jquery cycle based feature rotator that pulls from the post_tags. I added the post tags to my other custom post types like this:

register_taxonomy_for_object_type('post_tag', 'reviews');
register_taxonomy_for_object_type('post_tag', 'interviews');

When I add a 'featured' tag to one of my reviews and one of my interviews, and query for it thusly:

$query = new WP_Query( array( 'post_tag' => 'featured' ) );

I get two random posts instead of the two expected results. Any ideas?

share|improve this question
up vote 1 down vote accepted

Take a careful look at the arguments for WP_Query. By default, it queries for the post type post.

To select your custom post types, you need to change your query a little:

$query = new WP_Query( array(
    'post_type' => array( 'reviews', 'interviews' ),
    'post_tag'  => 'featured' 
) );
share|improve this answer
Doh! it's always something simple isn't it? Thanks I have been banging my head against a wall! – Jeff Lauder Jul 3 '12 at 17:46

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.