Title: multiple custom post types problem
Last modified: August 21, 2016

---

# multiple custom post types problem

 *  Resolved [Mikage](https://wordpress.org/support/users/mikage/)
 * (@mikage)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/multiple-custom-post-types-problem/)
 * I’ve added a second custom post types (the first was “Products” the second “Events”).
   I then created an event post.
 * If i browse the Events posts, the products posts appear as well and i can’t see
   the event post i created.
 * [http://wordpress.org/plugins/types/](http://wordpress.org/plugins/types/)

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

 *  Thread Starter [Mikage](https://wordpress.org/support/users/mikage/)
 * (@mikage)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/multiple-custom-post-types-problem/#post-4134822)
 * also, the problem arises when i check the “has_archive” option for the new custom
   post type
 *  [jozik](https://wordpress.org/support/users/jozik/)
 * (@jozik)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/multiple-custom-post-types-problem/#post-4135108)
 * Are you seeing both (or wrong) post types on frontend?
    like when visiting URL:
   [http://mysite.com/events/](http://mysite.com/events/)
 * Can you check rewrite slug settings?
 *  Thread Starter [Mikage](https://wordpress.org/support/users/mikage/)
 * (@mikage)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/multiple-custom-post-types-problem/#post-4135110)
 * Hello,
    I actually solved the problem. It was caused by using this function:
 *     ```
       function namespace_add_custom_types( $query ) {
         if( is_category() || is_archive() || is_tag() && empty( $query->query_vars['suppress_filters'] ) ) {
       		$query->set( 'post_type', array('post', 'prodotti', 'eventi', 'slideshow', 'nav_menu_item'));
       	  return $query;
       	}
       }
       ```
   
 * Enclosing the IF function in `if(!is_admin()) { }` solved my problem.
 *  [jozik](https://wordpress.org/support/users/jozik/)
 * (@jozik)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/multiple-custom-post-types-problem/#post-4135111)
 * Thanks for your feedback.

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

The topic ‘multiple custom post types problem’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/types_ced1d3.svg)
 * [Toolset Types - Custom Post Types, Custom Fields and Taxonomies](https://wordpress.org/plugins/types/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/types/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/types/)
 * [Active Topics](https://wordpress.org/support/plugin/types/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/types/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/types/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [jozik](https://wordpress.org/support/users/jozik/)
 * Last activity: [12 years, 7 months ago](https://wordpress.org/support/topic/multiple-custom-post-types-problem/#post-4135111)
 * Status: resolved