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

Hey i was wondering how could i show post from a certain taxonomy term in the loop.

 <?php the_excerpt(); ?>

I have a taxonomy entitled "series" under my post type entitled "Gallery", and in "series" i have the TERM "pretty-little-liars". Under my post type "pretty-litte-liars" archive it shows all the post posted in that CPT. I would like to add a code that also allows post posted under the taxonomy "series" with the term "pretty-little-liars" to show on that page as well.

what do i add to the above excerpt code to make this happen?

share|improve this question

Try this.

$type = 'buehne';  // Name of the Custom Post Types
$tag =  'TagName';

$args =  array(
        'post_type' => $type, 
        'paged' => $paged,
        'posts_per_page' => -1, 
        'orderby' => 'menu_order',
        'order' => 'ASC', 
            'taxonomy'=>'th3', //name of the Taxonom 

$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
    if(is_object_in_term($post->ID,'th3','TagName')) {  
        the_title(); ";

share|improve this answer
this looks complicated, where do i add this – Terrell Anderson Aug 21 '12 at 15:42
You have to Query a new loop with the Parameters you like to output. Place this code in your Template. with the Line is_object_in_term() you can filter the output you want. You could search in the codex page for custom post types and for is_object_in_term – user1606423 Aug 21 '12 at 15:54

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.