When I create a custom taxonomy, what template file is being used to display the page? How might I create a custom listing page for my custom taxonomy.
eg. I have a custom taxonomy skills. In it are values like: PHP, MySQL, HTML/CSS/JS …
When users goto say /skills/php
they will see all posts containing PHP in skills. What template is used by default for this page and how might I create a custom page template for this?
1 Answer
It really depends on your theme. Term archive views are governed by the rules of template hierarchy which means that more than one template may display these archives. For your project, I would suggest that you create a new template file called “taxonomy-skills.php”. This file will get use only for archives of skills enabling you to create a design that differs from other term archive pages.
You do not need to start from scratch. It often saves time to copy the contents of another file and adjust the code to your needs. I would first look for taxonomy.php. If it exists in your theme, copy and paste it’s contents into “taxonomy-skills.php”. If this file does not exist, try to locate the following files in the order specified: category.php, archive.php, index.php.
Best,
-Mike