Imagine this: I have a custom post type called 'Animals' and I have registered a taxonomy for this post type called 'Types of Animal'. 'Types of Animal' would be 'dog', 'cat' and 'mouse' and so on. So that's straightforward.

But say I want to introduce child taxonomies based on the value of the Types of Animal taxonomy. I can use the fact that the taxonomy is hierarchical but if Types of Animal contained 100 terms with 50 possible sub-terms, that makes for a big mess when I'm editing.

So what I'd like to do is display a child taxonomy, say 'Breeds', when the editor selects 'dog' in the 'Types of Animal' taxonomy.

I could use tags but I'm afraid of the margin of error inputting tags. I would rather that editors had to check a box.

Is it possible to display a child/secondary taxonomy dynamically in this way?

1 Answer 1


Have a look at this tutorial for a possible solution: How To Show/Hide WordPress Meta Boxes By Selecting Categories.

Basically, all of the taxonomies would be hidden via javascript, and a function attached to the click event of the Animals taxonomy, which inspects the selected item's ID to show a corresponding child taxonomy. You'd also have to have a bit of logic on page load to show the taxonomies with terms that are already selected.

There are potential problems though - what happens if someone deselects "dog", but not any child terms?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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