Problem: I would like to display the parent taxonomy term name on the child term's archive page.
Solution: There's not a way to do this with shortcodes alone, so you'll need to use Views or you can write your own custom code. The Views approach is described below.
- Create a new View of your taxonomy, filtered by taxonomy term ID, where the term ID is provided by a shortcode attribute "ids".
- In the Loop Output editor, place the taxonomy title shortcode or the taxonomy link shortcode - this will be used to display the parent term so format it however you would like.
- Place this View inside your taxonomy WordPress Archive's Loop Output editor, outside of the wpv-loop tags, but inside the wpv-items-found tag.
- Add the "ids" shortcode attribute to the View's shortcode, and use the wpv-taxonomy-archive tag to supply the value of the parent term ID:
[wpv-view name="your-view-slug" ids="[wpv-taxonomy-archive info='parent']"]
So you're accessing the parent term ID with the wpv-taxonomy-archive tag, and using that value to define the filter for another View. This is called passing arguments into a View.
Relevant Documentation: https://toolset.com/documentation/user-guides/passing-arguments-to-views/
Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.
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)
This topic contains 2 replies, has 2 voices.
Last updated by 6 years, 11 months ago.
Assisted by: Christian Cox.
The forum ‘Types Community Support’ is closed to new topics and replies.