Custom taxonomy and 404 not found issue
-
Hi there, i hope someone can help me with this issue which is driving me nuts.
I have created a simple plugin which registers a custom taxonomy (actors):
add_action('init', 'mct_register_actors_taxonomy', 0); function mct_register_actors_taxonomy() { $labels = array( // Some label definitions ); $args = array( 'exclude_from_search' => false, 'hierarchical' => false, 'labels' => $labels, 'show_ui' => true, 'public' => true, 'show_tagcloud' => false, 'show_in_nav_menus' => false, 'show_admin_column' => true, 'update_count_callback' => '_update_post_term_count', 'query_var' => true, 'rewrite' => array( 'slug' => 'actor', 'with_front' => true) ); register_taxonomy( 'actors', array( 'post' ), $args ); }
I created 3 posts for testing purposes, for each one of them i added one actor, let’s say: Test Post One has “Jack Nicholson”, Test Post Two has “Angelina Jolie” and Test Post Three has “Michael Douglas”.
I have set permalink structure to custom: /%postname%-whatever
If i navigate to http://mydomain/test-post-one-whatever everything’s ok and so for the other two posts
If i navigate to http://mydomain/actor/angelina-jolie everything’s ok and so for the other two actors; the archive.php layout of my template seems to take care of this content.
However, i can’t manage to get http://mydomain/actor/ to work, it always throws 404 Not found Error.
I have tried to get it working by creating these files inside my template’s directory:
taxonomy.php, taxonomy-actors.php, taxonomy-actor.php archive-actors.php, archive-actor.php
But none of them seem to work (and yes, i flush my permalinks everytime i make changes), it’s still giving me 404.
I would like some advise on this topic since i’ve spent hours trying to figure out what’s the problem with no luck.
- The topic ‘Custom taxonomy and 404 not found issue’ is closed to new replies.