[Resuelto] Display child category terms in alphabetical order and then display any posts
This support ticket is created hace 5 años, 8 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.
Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.
I want a series of category archive pages that display the children of the current archive category term page in alphabetical order and then display the posts belonging to those terms underneath each term. So for example I have a category term page of USA. When on that page I want to display child terms which will be American states and then under each state display any post that is a member of that term.
This is possible if you are creating a custom archive for your taxonomies.
So what you will need to do is create the custom archive for your taxonomy. Create a custom view for your child terms. Create a custom view that lists the posts.
1. Create the Posts view and add a Query filter to it for your taxonomy, then set the filter to "Set by parent taxonomy view"
2. Create the Taxonomy view and add a query filter to it for your taxonomy parent, then set the filter to "Parent is the term of the current taxonomy archive page"
3. Add you Post view to this taxonomy view.
4. In your taxonomy view you will need to add the correct shortcodes to display titles of the taxonomy terms. You can also order the taxonomies in this view by name as well.
5. Add your taxonomy view to your custom archive.
Thanks for this. This works perfectly for an archive page that has child taxonomy terms such as this page here: (Password: Europa-808)
enlace oculto
This page has child terms of particular USA states. However, for archive pages that dont have a child term (No states just the main country) nothing is displayed:
enlace oculto
UK has posts in it but nothing now displays. How do I have these archive pages just display a list of the posts in that parent category without affecting the functionality already created for pages like USA?
I see what you mean now, so you want the posts to display even if there are child terms.
I think I have a solution for this. You will probably need to create a 2nd Post view and add it to the "No Results Found" section of the taxonomy view.
On the Post view you will add the filter for the taxonomy and set it to get the taxonomy from the current archive page.
That's great and works well. Finally, how can I get the parent taxonomy term to appear at the top of the page, so for UK it says 'UK' for USA it says 'USA' etc.