Taxonomy Page
-
I got a custom taxonomy called author and I’m trying to create a page for it. This is what I’ve done so far:
1. I registered the taxonomy
add_action( 'init', 'register_taxonomy_author' ); function register_taxonomy_author() { register_taxonomy( 'author', 'post', //Let WordPress know that the artist taxonomy has posts array( 'hierarchical' => false, 'label' => 'Authors', // This tells WordPress how to label the various user interface outlets for the artist taxonomy 'query_var' => true, 'rewrite' => array( 'slug' => 'author', 'with_front' => false )) ); }
2. I created a new template called taxonomy-author.php and pasted the code from my category page there.Then I clicked the permalink settings to refresh it. Then I went to Posts > Authors > View which directed me to mysite.com/author/term/. So far so good. However, this page uses the index.php instead of taxonomy-author.php and displays all posts. What’s the problem?
The topic ‘Taxonomy Page’ is closed to new replies.