Title: Query posts using same taxonomy term
Last modified: August 19, 2016

---

# Query posts using same taxonomy term

 *  [mistercyril](https://wordpress.org/support/users/mistercyril/)
 * (@mistercyril)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/query-posts-using-same-taxonomy-term/)
 * Hello,
 * I have custom post types sharing a “Brands” taxonomy with posts.
    I would like
   to query and list 5 posts (post type “post”) in the custom post type “single”
   template.
 * The trick is that i’d like to query posts that use the same “Brands” term.
 *     ```
       <?php
           global $wp_query;
           query_posts(array('post_type' => 'post', "Brands" => "term_name", 'showposts' => 5 ));
           if (have_posts()) : while (have_posts()) : the_post();
           ?>
       ```
   
 * In this example “term_name” is hard coded and i’d like it to pick up the current
   custom post type’s “Brands” term (i.e. Cadillac).
 * This must be very simple but i’m stuck here.

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [joeybottle](https://wordpress.org/support/users/joeybottle/)
 * (@joeybottle)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/query-posts-using-same-taxonomy-term/#post-1937491)
 * Got same problem! Please help somebody. We need it 🙂 Thanks a lot!
 *  [devotee](https://wordpress.org/support/users/devotee/)
 * (@devotee)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/query-posts-using-same-taxonomy-term/#post-1937557)
 * Try this:
 * [http://pastebin.com/Vy7kqHqh](http://pastebin.com/Vy7kqHqh)

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Query posts using same taxonomy term’ is closed to new replies.

## Tags

 * [taxonomy](https://wordpress.org/support/topic-tag/taxonomy/)
 * [terms](https://wordpress.org/support/topic-tag/terms/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 3 participants
 * Last reply from: [devotee](https://wordpress.org/support/users/devotee/)
 * Last activity: [14 years, 9 months ago](https://wordpress.org/support/topic/query-posts-using-same-taxonomy-term/#post-1937557)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
