Custom Post Type Category subpage

Okay, so I have created a new custom post type, named sectors, and a sub category for this, named categories.

Back end

Read More
    add_action( 'init', 'create_sector_cat' );

function create_sector_cat() {
    register_taxonomy(
        'SectorCategories',
        'sectors',
        array(
            'label' => __( 'Sector Categories' ),
            'rewrite' => array( 'slug' => 'sectorcategories' ),
            'hierarchical' => true,
        )
    );
}

Now, when I press sector categories, it shows all categories which are created, using a file named sectorcategories.php

I then will have different ‘products’ inside this category, and I understand the filename should be taxonomy-sectorcategories.php, but this file isnt working?

Related posts

Leave a Reply

1 comment

  1. The first parameter is the taxonomy name. and according to the WordPress codex it should only contain lowercase letters and the underscore character. Read more

    I see you have a capital letter in your taxonomy name and that might be the problem. I could be wrong but I have run into trouble with this as well, i think it is very case sensitive.

    ps: I know this answer comes late but it if it works it might still help someone else.