Skip Navigation

[Geschlossen] View that filters Taxonomy Parent Terms/Child Terms

This support ticket is created vor 10 Jahre, 8 Monate. 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.

This topic contains 2 Antworten, has 2 Stimmen.

Last updated by Matthew vor 10 Jahre, 8 Monate.

Assigned support staff: bruce.

Author
Artikel
#7839

I have a custom taxonomy with name "Regions". It includes parent and child regions, i.e.:

Parent Region A
-Child Region A-1
-Child Region A-2
-Child Region A-3

Parent Region B
-Child Region B-1
-Child Region B-2
-Child Region B-3

I want to create views that will display posts according to the hierarchy of the Region taxonomy. i.e.:

Parent View:
filter a: Selects taxonomy of type "Region"
filter b: selects "Parent Region" taxonomy term

Child View:
filter: selects "Child Region" taxonomy term, based on parent view

Grand-Child View:
Select posts with "Child Regions", based on parent view

Not sure if this is possible/makes sense. In practical terms, I want a dynamic list output on the front end that looks like this:

Parent Region A Title
- Child Region A-1 Title
- - Post 1
- - Post 2
- - Post 3
- - etc

Parent Region B Title
- Child Region B-1 Title
- - Post 1
- - Post 2
- - Post 3
- - etc

Any ideas?

#7841

Hi Matthew,

You need to create 3 views for this.

The first View will select taxonomy that has a Parent of None. This will select the top parent.
The second View will select taxonomy that has a Parent set by the Parent View.
The third View will select Posts that have a Taxonomy set by the Parent View.

Similar to what we have here - https://toolset.com/learn/wordpress-classifieds-site/ - but you'll need to add the Post view.

Best regards,
Bruce

#7857

Perfect. Thanks Bruce.

Das Thema „[Geschlossen] View that filters Taxonomy Parent Terms/Child Terms“ ist für neue Antworten geschlossen.