Skip Navigation

[Resolved] How to display taxonomy of a parent post?

This thread is resolved. Here is a description of the problem and solution.

Problem:
When displaying child posts, how is it possible to display the taxonomy of a parent post?

Solution:
Use the id="$parent-slug" attribute in the shortcodes, like so:

[wpv-post-taxonomy id="$parent-slug"]

Relevant Documentation:
https://toolset.com/documentation/user-guides/displaying-fields-of-parent-pages/

This support ticket is created 6 years, 9 months ago. 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 1 reply, has 2 voices.

Last updated by Nigel 6 years, 9 months ago.

Assisted by: Nigel.

Author
Posts
#625121

Hi,
I have a parent CPT called "Books", which contains information about books, and it has extensive taxonomy to each book.
Then I have another CPT called "Online Text" that will contain the text of these books.
it is a child to the Books CPT and each post from the online text will be one chapter.

So if I create a book called "Science for Kids", then it will have multiple "Online Text" CPT posts, one for each chapter.

I want to show the taxonomy of the main book in the chapters. so instead of re-adding the taxonomy for each chapter, is there a way to "echo" the taxonomy of the parent post and show them in the children posts of another CPT?

in other words, How to create a View to show the taxonomy of the parent post?

so in my example, i add the taxonomy to the "Book" CPT post, and it shows automatically in all the chapters of the book that are posts of the "online text" CPT.

Thanks a lot.

#625184

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi there

When you insert a shortcode to output a field or taxonomy, e.g. wpv-post-taxonomy (https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-post-taxonomy), you can use the id attribute to specify an alternate post to use as the source, and by using the slug of a parent post type can specify the parent post as the source, e.g.

[wpv-post-taxonomy id="$book"]

See this page for more details: https://toolset.com/documentation/user-guides/displaying-fields-of-parent-pages/