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've registered a couple of custom taxonomies to go with a couple of custom post types but I'm having some trouble getting a template file to work.

I've tried taxonomy.php, taxonomy-[termname].php, taxonomy-[taxonomyname].php but none seem to register and the link reverts to index.php

You can see an example of this here - http://wordman.deanelliott.me/portfolio/ just click on any of the links inside the yellow box and instead of going to a specific taxonomy template page it uses index.php

I'm not sure if it makes a difference, but this is the code I'm using to register the taxonomy

register_taxonomy('cat', 'portfolio',  array('hierarchical' => false, 'label' => 'Category','query_var'  => true, 'rewrite' => true));
share|improve this question
up vote 0 down vote accepted

I think this is because you use a reserved name: http://codex.wordpress.org/Function_Reference/register_taxonomy#Reserved_Terms

Try changing in to something else like:

register_taxonomy('portfolio_category', 'portfolio',  array('hierarchical' => false, 'label' => 'Category','query_var'  => true, 'rewrite' => true));
share|improve this answer
That stopped index.php from being used, but it still doesn't seem to want to use any of the taxonomy template files I created (It doesn't seem to use any, all I get is the header and footer, no content) – Dean Elliott Dec 20 '11 at 23:51
Are you sure the taxonomy.php template has some code in it (besides get_header and get_footer)? Here you can see the template hierarchy: codex.wordpress.org/images/1/18/Template_Hierarchy.png It has to be one of those templates under custom taxonomy archive. And don't forget to flush your permalink rewrite rules (go to permalinks under settings and thats done). – Rob Vermeer Dec 20 '11 at 23:56
I just went back to the test site to do this and it appears to be working now. Maybe it was just the browser cache playing tricks on me. Thanks for your help anyway – Dean Elliott Dec 21 '11 at 10:13

I think you need to have the 'portfolio' inside an array like this:

register_taxonomy( 'cat', array( 'portfolio' ),  
    'hierarchical' => false, 
    'label' => 'Category',
    'query_var'  => true, 
    'rewrite' => true)
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.