Saltar navegación

[Resuelto] Output child / sub categories only

Este hilo está resuelto. Aquí tiene una descripción del problema y la solución.

Problem: I would like to show a View of taxonomy terms that are child terms of a specific parent term

Solution:
Here's how you can set this up:
1. Create a View of the taxonomy and add a Query Filter, filtered by term parent, where term parent is "None". This View will show the top-level terms in the term hierarchy. In the loop of this View, insert the term title or term link.
2. Create another View of the same taxonomy, again filtered by term parent, but this time where the term parent is set by the parent taxonomy View. In the loop of this View, insert the term title or term link.
3. Return to the first View and in the Loop after the term title, insert View 2.
4. Place View 1 on a custom Page somewhere to test it out.

Relevant Documentation:
https://toolset.com/documentation/user-guides/filtering-views-by-taxonomy/
https://toolset.com/documentation/user-guides/using-a-child-view-in-a-taxonomy-view-layout/
https://toolset.com/documentation/user-guides/passing-arguments-to-views/
https://toolset.com/documentation/user-guides/filtering-posts-by-user-selected-taxonomy/

This support ticket is created hace 6 años, 9 meses. 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)

Este tema contiene 2 respuestas, tiene 2 mensajes.

Última actualización por Paul hace 6 años, 9 meses.

Asistido por: Christian Cox.

Autor
Mensajes
#629078

Hi there,

I need a way of creating a view which will output the child / sub categories taxonomy links when given a shortcode parameter telling it which parent category to use.

I know this might involve combining two views - one inside the other potentially. Can you help?

Thanks

#629276

Hi, I think what you're describing can be accomplished with two Views like you mentioned. Here's how you can set this up:
1. Create a View of the taxonomy and add a Query Filter, filtered by term parent, where term parent is "None". This View will show the top-level terms in the term hierarchy. In the loop of this View, insert the term title or term link.
2. Create another View of the same taxonomy, again filtered by term parent, but this time where the term parent is set by the parent taxonomy View. In the loop of this View, insert the term title or term link.
3. Return to the first View and in the Loop after the term title, insert View 2.
4. Place View 1 on a custom Page somewhere to test it out.

#629501

Hi Christian,

That's an awesome response and you've definitely pointed me in the right direction! I'll try it out and let you know!

Thanks again

Paul