Archive pages for posts based on their taxonomy?

Is it possible to display archive pages of posts based on their taxonomies, and an archive page of a term in that taxonomy??

For example, i have a site about beauty products, and i write a product review as a post. I want to put it in the ‘hair’ category, and in the taxonomy ‘shampoo’, with the term ‘dry’. I have managed to create an archive page for all posts within the ‘hair’ category, but i cant figure out how i then create a page to show all products that are in ‘hair’ AND with a taxonomy of ‘shampoo’. I would also need a further page showing all products in ‘hair’ AND ‘shampoo’ AND ‘dry’. ie. mysite/hair/shampoo/dry where hair is the category, shampoo is the taxonomy, and dry is the term.

Read More

Am i on the right track in thinking i need to create a taxonomy-shampoo.php page? Any help would be greatly appreciated. Thanks,
Patrick.

Related posts

Leave a Reply

3 comments

  1. The Template Hierarchy Codex entry is your friend.

    • Archive page for category hair: category-hair.php
    • Archive page for taxonomy shampoo: taxonomy-shampoo.php
    • Archive page for taxonomy shampoo term dry: taxonomy-shampoo-dry.php

    To display some cross-query between different taxonomies, such as category and a custom taxonomy, such as hair, you’ll need to do a custom query, and display it on your own custom page template, or something similar.

  2. Check it, WordPress supports templates for taxonomy archives, both for the taxonomy itself and its individual terms, out of the box: http://codex.wordpress.org/File:Template_Hierarchy.png

    But unfortunately, I don’t know how to make a taxonomy for a taxonomy (categories are simply a kind of taxonomy, a default kind). All taxonomies exist unto themselves, in separate permalink structures.

    Looking at your example, I want to know, why not just make “shampoo” a sub-category of “hair?” Then you’d get your URL of mysite/categories/hair/shampoo/dry.