This may be really obvious, but I can’t find other documentation or questions about it.

Scenario

I have a directory of Businesses (custom post types). Each Business has a “Type” (custom taxonomy). The Business Types are hierarchical, such as Eat > Restaurant > African, Play > Parks, Services > Medical > Dental, etc.

Other Notes:

  • My “Type” archives should work with the core implementation and no modifications (e.g. the Restaurant archive should show all posts in that term or any child term).
  • I expect I’ll be using get_terms() quite a bit in my templates.
  • I expect I’ll need the additional templates provided by the Category Template Hierarchy if it supports custom taxonomies.
  • I may need to use the term descriptions from the parent at times.
  • I may integrate the Taxonomy Images plugin and possibly need the parent term’s image.

Question

When entering each business, should all parent and child terms be selected or should I only select the “deepest” term (i.e. Should I assign it to “Eat,” “Restaurants,” and “African” or just “African?”)? Is the “correct” answer in my case the “correct” way of using hierarchical taxonomies or does the “correct” answer depend on the use case?

1 Answer
1

Use the deepest term only. If you want to rearrange the term relations later you don’t have to go through all posts to fix the post-term relations. Plus, you are more flexible when you want to separate the posts with child terms from post associated with the current term only.

Leave a Reply

Your email address will not be published. Required fields are marked *