Skip Navigation

[Resolved] Display taxonomy related items with a shortcode

This support ticket is created 3 years, 5 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+01:00)

This topic contains 4 replies, has 2 voices.

Last updated by milanV 3 years, 4 months ago.

Assisted by: Nigel.

Author
Posts
#2286597
goal.PNG
example.PNG

Hello everyone,

I'm using toolset to setup a website, i created a custom post type, a custom taxonomy linked to this post type and then i created customs fields related to the taxonomy.

For my website i'm using Divi and i would like to create all the templates with it (theme builder). I would like to customize the taxonomy categories and sub-categorie template ( see the screenshot example), currently i can display the custom fields on the template but i'm struggling with how i can display the items loop and pagination with a shortcode.

As you can see on the "goal" screenshot, i would like to keep the display of all the taxonomie page related items, i can't find the right shortcode to put in divi to display it. Furthermore i would like to edit how to display the different information of all items . I search on the forum but i didn't find any answer. If you can help it would be awesome as my problem is a bit specific.

Have a good day !

#2286881

Nigel
Supporter

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

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

Hi there

To recap, you have a custom post type with a custom taxonomy assigned.

You are working on the taxonomy archives (which means displaying a list of posts that have the taxonomy term specified in the URL assigned), and you are using Divi to design the template for these archives.

I'm not sure I follow what it is you want to output on these pages using shortcodes. You mention the items loop and pagination, but if you are designing your custom archives with Divi then that's not related to Toolset.

If you want to output details of the taxonomy—including term meta for your custom taxonomy—then there are several shortcodes that can help you.

See the documentation for Views shortcodes here: https://toolset.com/documentation/programmer-reference/views/views-shortcodes/

Note there are several shortcodes for outputting fields of taxonomy terms, e.g. wpv-taxonomy-title, wpv-taxonomy-slug, wpv-taxonomy-link, wpv-taxonomy-url, and wpv-taxonomy-field (https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-taxonomy-field) which can be used to output custom fields of your taxonomy terms.

It's not clear in the documentation, but if you use these shortcodes in the context of a taxonomy archive they should output content based on the term being queried for the archive.

If you are looking for something else, please give some specific examples for us to understand what you need.

#2287665
Capture.PNG

Heya Nigel, first of all thanks for your answer.

I understood how to get all the meta keywords for the taxonomy. My problem is the following: i would like to display the "view" (see the screenshot): the thing that display all of the items related to the category, as a shortcode. My goal is to create one and only templates for all archives pages and on this template (created by divi), i would like to display the current taxonomy archive custom fields (done, i know how to do that) and also the "view", the loop that display every custom type items related to this taxonomy. I'm looking for shortcodes or something that i can put in divi. Furthermore, i would like to understand how can i edit the template of each item in the "view".

From what i understand i may create a specific view in toolset no ?

If it's not clear let me know, i can understand that it's a bit confusing haha

Thanks in advance !

#2298849

Nigel
Supporter

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

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

Sorry Milan, there was a glitch in our system and this thread has been lost in no-man's land until now.

If I have understood you correctly, you are adding a View to a template that is used to display various archives, and you want the View to display posts that have assigned the taxonomy term coming from the current archive, is that right?

In which case you should just need to add a Query Filter to the View for the taxonomy, where the term is set by the current archive. (If you are using the block editor and creating the View with the View block then you can set the query filter in the Content Selection settings with the View block selected; if you are using the legacy editor the setting should be near the top of the page.)

You can insert the View in your Divi template using the Toolset View widget. Alternatively, use the wpv-view shortcode in a text module (https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-view)

#2298993

My issue is resolved now. I didn't find it before but yes we can select the taxonomy as a filter but in the view section, not when we build it on the front. Thank you!