[Résolu] Filtering by child taxonomy in WordPress Archive
Ce fil est résolu. Voici une description du problème et la solution proposée.
Problem:
I would like to have a page for each category (like car, motoribike, truck) so I have chosen WordPress Archives as the easiest way (just to create one archive and it will be used on all the given taxonomy). And what I would like, is to have links to child category. So in URL it would be /car/ and on this page will be list of all the cars and also links to child categories (pickup, SUV,...) and on the child pages there should be links to parent and to other child taxonomy. The children will not have any other children, so it´s only Parent -> Child, not another levels.
Solution:
It needs only one Taxonomy view + one WordPress archive, for example:
This support ticket is created Il y a 5 années et 7 mois. 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.
Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.
Hello. Thank you for contacting the Toolset support.
Well - the thing is that search filter with taxonomy archive will not work. We already display the notice when you add the filter to taxonomy archive:
This filter will not be applied to Taxonomy Archives matching the filtered taxonomies:
You will find above message with "Query Filter" section on your taxonomy archive - do you see it? or I misunderstood anything here.
Currently, it's possible to filter a taxonomy term archive based on that same taxonomy, You can say this is a limitation and even its design by WordPress.
Hi, when you add this filter no notice will be displayed. You have to reload the whole page to get this notice, so it is visible now. It would be useful if it appear immediatelly.
But it does not solve my problem. So is there any way to achieve this? Like inserting View with child taxonomy?
Hi Minesh, so it means that I have to create a page for each category? Because I would like to have a name of the category in URL, that was the reason why I have chosen to use the archive. Also I want to use the category description.
Well - there is no way to insert to filter that displays only child terms of taxonomy.
The only way I can think of is you should create a view with taxonomy filter and add it to your archive "Loop Editor" section as given under just before the [wpv-items-found] shortcode:
Thanks, I have followed your recommendation, but as you also wrote, it displays all the terms, which is not what I would like to and also it does not show the description for the taxonomy by the selected taxonomy.
So if I quit the filtering, would it be possible to display just the links to child archives which belong to the parent one (and the opposite)?
Well - I have another way to offer you. But it's using views not archives.
the following will be the structure:
PARENT CATEGORY
--- CHILD CATEGORY
--- POST belongs to child category
If this is correct, its 3 levels where:
- PARENT CATEGORY is first level, for that we need to create a taxonomy view
- CHILD CATEGORY is second level, where you need to fetch only child categories whose parent is -(PARENT CATEGORY) first level.
- POST whose parent is (CHILD CATEGORY) second level.
Thanks for the link. Before I begin to follow the steps, I would like to know if each parent and even child category will have own page (for SEO purposes and to be easyly linked) and I can use the taxonomy description?
Minesh is on vacation, I will take care of this thread.
Please elaborate the question with more details: I would like to know if each parent and even child category will have own page
Where and how do you want to setup the category own page?
in basics I would like to have a page for each category (like car, motoribike, truck) so I have chosen WordPress Archives as the easiest way (just to create one archive and it will be used on all the given taxonomy). And what I would like, is to have links to child category. So in URL it would be /car/ and on this page will be list of all the cars and also links to child categories (pickup, SUV,...) and on the child pages there should be links to parent and to other child taxonomy. The children will not have any other children, so it´s only Parent -> Child, not another levels. See attachment.
Thanks for the details, in your case, it needs only one Taxonomy view + one WordPress archive, for example:
1) You can create a taxonomy view "child-terms":
- Query terms of taxonomy "kategorie"
- filter by:
Select taxonomy terms whose parent is the current taxonomy archive.
- in section "Loop Editor", within Views loop, display term's archive page link:
[wpv-taxonomy-link] https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-taxonomy-link