Skip Navigation

[Resolved] What is the correct code for conditional content based on taxonomies

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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 4 replies, has 2 voices.

Last updated by catherineB 1 year, 2 months ago.

Assisted by: Minesh.

Author
Posts
#2637259

Tell us what you are trying to do?
In my location's directory, I want to display the post information conditionnaly to which taxonomy is enable
I've tried many codes, but nothing seems to work
-
[wpv-conditional if="('[wpv-quartier-qc]' eq 'Montréal')"] [/wpv-conditional] - Don't work
[wpv-conditional if="( '[taxonomy output='quartier-qc']' eq 'eat-drink' ) "] [/wpv-conditional] - Don't work
[wpv-conditional if="( '[taxonomy output='wpv-quartier-qc']' eq 'eat-drink' ) "] [/wpv-conditional] - Don't work (added wpv-)

What would be the good code?

Is there any documentation that you are following?
https://toolset.com/forums/topic/taxonomy-condition-display/ and many other ones

What is the link to your site?
hidden link

#2637461

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Can you please try to follow the following Doc and try to resolve your issue:
- https://toolset.com/documentation/legacy-features/views-plugin/displaying-taxonomies-conditionally/#specific

#2637643

Hi Minesh,

Thanks for the link. I don't knwo why I didn't see the [conditional] option in the menu haha

It works perfectly for one-word taxonomies (ex: Divertissement), but when it comes to many-words taxonomies (ex: Soins médicaux), it doesn't work

I tried with the whole term or just a part of it, but it seems the system do not do the link
[wpv-conditional if="( CONTAINS(#(categories-lieux),'soins') )"]

Do I need to change the taxonomy title or put in into shortode or brakets?

Catherine 🙂

#2637693

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

It seems you are using the taxonomy term title "Soins médicaux" - what if you try to use the taxonomy term slug.

For instance:

[wpv-conditional if="( CONTAINS(#(categories-lieux),'term-slug') )"] show [/wpv-conditional]

Where:
- Replace 'term-slug' with your original term slug.

Does that helps? If no:

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#2637789
#2637791

It works, thanks!