Skip Navigation

[Resolved] Nested hierarchical taxonomy View

This thread is resolved. Here is a description of the problem and solution.

Problem: I would like to show a View of all the terms in a custom hierarchical taxonomy, and I would like to use indentation or nesting to represent the hierarchy.

Solution: You can use two Taxonomy Views filtered by parent term to accomplish this.
- Create a taxonomy View filtered by term parent, where term parent is "None". This will give you a loop of all the top-level terms.
- In the Loop Output editor, include a link to the term archive
- Create another taxonomy View filtered by term parent, where the term parent is set by the parent View. This will give you a loop of all the subordinate terms underneath each parent term.
- In the Loop Output editor, include a link to the term archive
- Insert the 2nd View inside the 1st View just after the link to the parent term archive.

This support ticket is created 6 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 1 reply, has 2 voices.

Last updated by Christian Cox 6 years, 10 months ago.

Assisted by: Christian Cox.

Author
Posts
#607540

I am trying to: Sort the taxonomy view event locations by country and have the locations within each country nested.

So at the moment the locations look like this:
UK
Leeds
Hebden Bridge
India
Goa
Dorset (this is in the UK)
Manchester (this is in the UK)

I want them to look like this:

UK
> Dorset (alphabetically)
> Hebden Bridge
> Leeds
> Manchester

India
> Goa

Link to a page where the issue can be seen: hidden link

#607675

Hi, one way to do this is to use nested taxonomy Views. This requires two taxonomy Views filtered by term parent. Here's the general idea:
- Create a taxonomy View filtered by term parent, where term parent is "None". This will give you a loop of all the top-level terms, like "UK" and "India". If these terms need to be filtered by the current post as well, feel free to add additional filters to produce the desired top-level results.
- In the Loop Output editor, include a link to the term archive
- Create another taxonomy View filtered by term parent, where the term parent is set by the parent View. This will give you a loop of all the subordinate terms underneath each parent term. If these terms need to be filtered by the current post as well, fell free to add additional filters to produce the desired subordinate results.
- In the Loop Output editor, include a link to the term archive
- Insert the 2nd View inside the 1st View just after the link to the parent term archive.