WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a plugin free custom post type and taxonomy setup - see below. From this I get an archive of the CPT at:


If I use the_terms( $post->ID, 'nomination_type' , ' ' ) I get a nice link to my taxonomy term archives in each of my nomination posts i.e:


Going to this url gives me an archive page with a title "Best 2013" as you would expect, but I can't for the life of me get it to show any posts..refreshed permalinks etc etc

Any help much appreciated...

add_action( 'init', 'create_nomination_post_type' );
function create_nomination_post_type() {
    register_post_type( 'nomination',
            'labels' => array(
                'name' => __( 'Nominations' ),
                'singular_name' => __( 'Nomination' ),
                'add_new_item' => __( 'Add New Nomination' )
        'public' => true,
        'menu_position' => 6,
        'exclude_from_search' => true,
        'has_archive' => true,
        'rewrite' => array('slug' => 'nomination-archive'),
        'supports' => array( 

// Add nominatons type taxonomy
function add_nomination_type_taxonomies() {
    register_taxonomy('nomination_type', 'nomination', array(
        // Hierarchical taxonomy (like categories)
        'hierarchical' => true,
        'labels' => array(
            'name' => _x( 'Nomination Categories', 'taxonomy general name' ),
            'singular_name' => _x( 'Nomination Categories', 'taxonomy singular name' ),
            'search_items' =>  __( 'Search Nomination Categories' ),
            'all_items' => __( 'All Nomination Categories' ),
            'parent_item' => __( 'Parent Nomination Categories' ),
            'parent_item_colon' => __( 'Parent Nomination Category:' ),
            'edit_item' => __( 'Edit Nomination Category' ),
            'update_item' => __( 'Update Nomination Category' ),
            'add_new_item' => __( 'Add New Nomination Category' ),
            'new_item_name' => __( 'New Nomination Category Name' ),
            'menu_name' => __( 'Nomination Item Categories' )
         //Control the slugs used for this taxonomy
        'rewrite' => array(
            'slug' => 'nomination-type' // This controls the base slug that will display before each term
          //    'with_front' => true, // Don't display the category base before "/genres/"
            //'hierarchical' => false // Allows good urls
add_action( 'init', 'add_nomination_type_taxonomies', 0 );
share|improve this question

I may be an idiot - not sure. Probably indicates I am.

Setting 'exclude_from_search' to 'false' for the CPT clears up this problem.

Still not quite sure why the CPT archive works and the taxonomy ones do not when 'exclude_from_search' is 'true' but there you go.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.