Support » Fixing WordPress » When i add a custom taxonomy to a custom post_type the posts disappear

  • Hi

    I’m having a weird problem with custom post_types and custom taxonomies, when I add a custom post_type with a custom taxonomy and add posts to the post_type I cannot view all posts in that post_type.

    When I remove the custom taxonomy I can view the posts fine. I have a number of other custom taxonomies setup under standard posts and these are working fine.

    register_taxonomy(
    		'filter',		// internal name = machine-readable taxonomy name
    		'portfolio',		// object type = post, page, link, or custom post-type
    		array(
    			'hierarchical' => true,
    			'label' => 'Filters',	// the human-readable taxonomy name
    			'query_var' => true,	// enable taxonomy-specific querying
    			'rewrite' => array( 'slug' => 'filter' ),	// pretty permalinks for your taxonomy?
    		)
    	);
    register_post_type( 'portfolio',
    		array(
    			'labels' => array(
    				'name' => __( 'Portfolios' ),
    				'singular_name' => __( 'Portfolio' ),
    			),
    			'_builtin' => false,
    			'public' => true,
    			'query_var' => true,
    			'hierarchical' => false,
    			'taxonomies' => array( 'filter' ),
    			'supports' => array( 'title', 'editor', 'excerpt', 'custom-fields', 'thumbnail' ),
    			'rewrite' => array( 'slug' => 'portfolio', 'with_front' => false ),
    			//'register_meta_box_cb'=>'add_meta_boxes',
    		)
    	);
  • The topic ‘When i add a custom taxonomy to a custom post_type the posts disappear’ is closed to new replies.