Title: Same category for different CPT
Last modified: August 31, 2016

---

# Same category for different CPT

 *  [fede.giro](https://wordpress.org/support/users/fedegiro/)
 * (@fedegiro)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/same-category-for-different-cpt/)
 * Hi! I’m trying your plugin to filter content in my website.
 * I have three custom post types:
    – news – articles – stories
 * Each of them are associated to a particular taxonomy:
    – tax 1 for news – tax
   2 for articles – tax 3 for stories
 * And also all of the three CPT shares the same WP built-in taxonomy (the classic
   category).
 * I’m displaying the filter in each of the three archive pages for the CPTs. The
   filter have two fields, one for the category and one for the taxonomy. Ej in 
   the news page archive:
 * All Categories – All tax-1 terms – Search button
 * If I select a term from the taxonomy dropdown, the filter works fine as i get
   the posts that have that term. But if i select a category from the first dropdown,
   i’m getting posts from the other CPTs that belongs to that category, instead 
   of the ‘news’ posts.
 * The shortcode i’m using is this:
 * `<?php echo do_shortcode( '[searchandfilter fields="category,tax-1" submit_label
   ="Filter" search_placeholder="Buscar..."]' ); ?>`
 * [https://wordpress.org/plugins/search-filter/](https://wordpress.org/plugins/search-filter/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [Ross Morsali](https://wordpress.org/support/users/designsandcode/)
 * (@designsandcode)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/same-category-for-different-cpt/#post-7433095)
 * Have you tried restricting the post types in the search forms?
 * [http://docs.designsandcode.com/search-filter/#options](http://docs.designsandcode.com/search-filter/#options)
 * `[searchandfilter post_types="post,page"]`
 * It sounds like the query is being modified by your theme, that bit of code might
   just get around it.
 * Thanks

Viewing 1 replies (of 1 total)

The topic ‘Same category for different CPT’ is closed to new replies.

 * ![](https://ps.w.org/search-filter/assets/icon-256x256.png?rev=3096093)
 * [Search & Filter](https://wordpress.org/plugins/search-filter/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/search-filter/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/search-filter/)
 * [Active Topics](https://wordpress.org/support/plugin/search-filter/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/search-filter/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/search-filter/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Ross Morsali](https://wordpress.org/support/users/designsandcode/)
 * Last activity: [9 years, 11 months ago](https://wordpress.org/support/topic/same-category-for-different-cpt/#post-7433095)
 * Status: not resolved