1
votes

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

Back end

    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?

1
Anyone? I don't understand why it isn't finding the page, I have looked into the Taxonomy Diagram too!user2209033
Patience, your post has been only viewed 9 times (at the time of my comment) and it was posted 7 hours ago. Personally I tried to help but it is hard to understand (for me at least) exactly what you are asking. Do not worry some one may understand it perfectly and be able to answer it.Helmut Granda

1 Answers

0
votes

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.