Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

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.

share|improve this answer
    
That makes sense. Are there any downsides to NOT marking the parent? –  mrwweb May 31 '12 at 23:43
    
I’m not aware of any downsides. Let’s wait wait others have to say. :) –  toscho May 31 '12 at 23:46
    
I wish I'd get another opinion or two on this one, but this answer has served me well so far. The only downside has been that parent terms aren't reflected in the tag cloud unless they're explicitly set. –  mrwweb Jul 7 '12 at 20:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.