Skip Navigation

[Resolved] displaying content with views

This support ticket is created 6 years 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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 1 reply, has 2 voices.

Last updated by Luo Yang 6 years ago.

Assisted by: Luo Yang.

Author
Posts
#1145190

Tell us what you are trying to do?
I have some custom taxonomies for my custom post type. There are 20 different taxonomies/categories.

I understand how to list all the categories on the front end that have been chosen. Is there a way to show the categories that NOT have been chosen? Think if it like this .....

Custom Post Type: CARS
Custom Taxonomies/Categories: CAR OPTIONS

Front End Display users would see:

Here are the car options you have chosen:
Heated Seats, Satellite Radio, Rear View Camera, Red Paint
(the above are the Taxonomies/Categories that were chosen, displayed to the user)

Here are the car options you did not choose:
Bigger Engine, Bigger Tires, Sunroof, Turbo
(the above are the Taxonomies/Categories that WERE NOT chosen, displayed to the user)

Is this possible to do ?

Is there any documentation that you are following?

Is there a similar example that we can see?

What is the link to your site?

#1145566

Hello,

For the problem: Is there a way to show the categories that NOT have been chosen?

It is possible with a taxonomy view, within view's loop, you can use [wpv-conditional] shortcode to check if current post does not have this specific term, then display this term information, for example:
in a single "CARS" post:
1) Dashboard-> Toolset-> Settings-> Front-end Content
option "Functions inside conditional evaluations", add function name: has_term

2) Create a taxonomy view, query term of taxonomy "CAR OPTIONS", no other filter

3) in the view's loop display the term link like this:

[wpv-conditional if="( has_term('[wpv-taxonomy-slug]', 'category', '[wpv-post-id]')) " ]
 [wpv-taxonomy-link]
 [/wpv-conditional]

More help:
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/using-custom-functions-in-conditions/
https://codex.wordpress.org/Function_Reference/has_term