WordPress.org

Ready to get started?Download WordPress

Forums

Types - Custom Fields and Custom Post Types Management
[resolved] multiple custom post types problem (5 posts)

  1. Mikage
    Member
    Posted 11 months ago #

    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/

  2. Mikage
    Member
    Posted 11 months ago #

    also, the problem arises when i check the "has_archive" option for the new custom post type

  3. Srdjan
    Member
    Plugin Author

    Posted 10 months ago #

    Are you seeing both (or wrong) post types on frontend?
    like when visiting URL: http://mysite.com/events/

    Can you check rewrite slug settings?

  4. Mikage
    Member
    Posted 10 months ago #

    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.

  5. Srdjan
    Member
    Plugin Author

    Posted 10 months ago #

    Thanks for your feedback.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.