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.

The way WordPress handles taxonomies and terms isn't fool proof enough for the users of a project I am currently working on.

Here's the example I need:

I have a "Conference" taxonomy, a "Divisions" taxonomy, and a "Teams" taxonomy.

I need the Divisions to be a child of the Conference and the Teams to be the child of the divisions.

So the hierarchy would look like:

Conference: NFC
>Divisions: East
>>Teams: Giants

Has anyone done this before? Any help appreciated.

Thanks.

share|improve this question
add comment

2 Answers

I have run into similar problem with the system I am currently building - I needed ZIP codes to be children of Cities, which were to be children of States. What I have learned is that it was possible to add custom fields to the term creation form to link the term (e.g. ZIP) to the parent term from Cities taxonomy, but it was not an ideal solution.

What I have end up with was just one hierarchical taxonomy Location, were first level terms are always states, second level terms were cities and third level were ZIP codes. Of course, there is nothing that stops users from submitting ZIP code as top-level term, but I am hoping that my users are not dumb enough to do that. :) I have then built a number of supporting functions to determine what is the hierarchy level of given term.

share|improve this answer
add comment

Nope. You can't. Taxonomies can't be assigned to the other taxonomies.

Why you wouln'd just create a posts assigned to this taxonomies and create required strcutrure?

one of the examples (i did last year) - http://lindyssports.com/nba - NBA (show all posts from NBA League) - http://lindyssports.com/nba/EASTERN - ESTERN ( shows all posts from NBA -> Eastern) - http://lindyssports.com/nba/EASTERN/AL - Athlantic (hows all posts from NBA -> Eastern - Athlantic)

(this is just a quick example as it was some time ago...)

the work involced to do that was in

  • generating correct rewrite rules
  • generating taxonomy and post_type links.

everything rest was based on native wp code.

share|improve this answer
add comment

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.