[Résolu] display taxonomy's parent in taxonomy view
This support ticket is created Il y a 2 années et 2 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.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
I have a taxonomy view which appears inside a search view. The search is showing posts, the taxonomy view in it is showing, separately, the taxonomy matching the current search term.
for example, searching for "wheels" will show all posts with "wheels" in the title, and also all taxonomies with "wheels" in the title.
so far so good, everything works.
what i want now is, inside the taxonomy view, to show not only the taxonomy name, but also it's parent (if it has one). the reason is I can have 2 taxonomies called "wheels", but the first's parent would be "objects" and the second's parent would be "circles" (just an example, these are not the actual names...), so I need to show that the first "wheels" is the child of "objects" and the second is the child of "circles"
i know i can create another taxonomy view with filter of "parents" set to "none", thus displaying the top taxonomies in the hierarchy, but I need to also relate it to the current taxonomy, which i can't get my head around...
thx!
The attribute "term_id" expects the target term's ID which is passed using the shortcode "[wpv-taxonomy-id]" and the attribute "taxonomy" expects the slug of the target taxonomy, which in this example is "category".
Note: The custom code examples from our forum are shared to get you started in the right direction. You're welcome to adjust them as needed and for more personalized customization assistance, you can consider hiring a professional from our list of recommended contractors: https://toolset.com/contractors/