Skip Navigation

[Resolved] Display only one term with Taxonomy ShortCode

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

Problem:
Can we limit the amount of terms displayed by the wpv-post-taxonomy shortcode?

Solution:
No, because it is not possible to tell which one you'd like to show, without setting query parameters, and hence, this should be done in a View.

You can create a View, choose to query Taxonomies and add a Query filter to query terms as assigned to the post where the view is inserted to.
Then in the View loop, you can input data of the Term/Taxonomy to display.
You can set this View to return just one result or as many you like, and alter ordering and more options.

Relevant Documentation:

https://toolset.com/documentation/user-guides/views-shortcodes/#vf-153472

See https://toolset.com/documentation/user-guides/filtering-views-by-taxonomy/ for more details

This support ticket is created 5 years, 4 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
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Tagged: 

This topic contains 2 replies, has 2 voices.

Last updated by bobA-2 5 years, 4 months ago.

Assisted by: Beda.

Author
Posts
#1327957

There isn't a way only to get one value with [wpv-post-taxonomy type="category" format="name"] right? If the Post has two categories I only want one shown.

#1328005

No, because it is not possible to tell which one you'd like to show, without setting a lot of query parameters, and hence, this should be done in a View.
See also the ShortCodes description here:
https://toolset.com/documentation/user-guides/views-shortcodes/#vf-153472

You can create a View, choose to query Taxonomies and add a Query filter to query terms as assigned to the post where the view is inserted to.
Then in the View loop, you can input data of the Term/Taxonomy to display.
You can set this View to return just one result or as many you like, and alter ordering and more options.
See https://toolset.com/documentation/user-guides/filtering-views-by-taxonomy/ for more details

#1328065

My issue is resolved now. Thank you!