I'm struggling with taxonomies. I've created a custom post type ("Products") with taxonomies like this:
- Kitchen Accessories
Basically, when I click on Saucepans I'd like to display every items in Saucepans (and exactly the same for Cutlery).
But when I click on Kitchen Accessories, I don't want to display every items, I just want a list like this :
And now, when I click on Mixers for example, I'd like to display every items in Mixers.
John Cotton answers:
The simplest way would be to have a custom template for those terms where you wanted that effect.
So create a file in your theme called taxonomy-kitchen-accessories.php, copy the contents of an existing file to get the basic structure and then replace the loop with your list using, for example [[LINK href="http://codex.wordpress.org/Function_Reference/get_term_children"]]get_term_children[[/LINK]]
Thank you so much, it's working quite well but what should I do if I don't want to create a new file?
John Cotton comments:
Well you would have to have some if..else code in one of your other template files. But then the code starts to get messy....
Always best to go with the flow grain of how WordPress works....
Yeah, you're right.
Anyway, thanks for your help.