Skip Navigation

[Resolved] Conditional in taxonomy view with has_term

This support ticket is created 2 years, 8 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.

This topic contains 1 reply, has 1 voice.

Last updated by David Gimenez 2 years, 8 months ago.

Author
Posts
#2343783

Hello.

I have a problem

I want to get differents URL in a conditional taxonomy view. I am using has_term but it doesn't work. If the slug of the term is vins-i-caves i will use one URL. If the slug term is not vins-i-caves i will use another URL.

Here is my code of th loop item and it's not working. the URL always is like taxonomy has not the term vins-i-caves, but i have a txonomy with slug vins-i-caves.

[wpv-conditional if="( has_term('vins-i-caves', 'product_cat', null) eq '1' )" ]
<div class= "espacio3 botonMenuCartaQR"><a href="../vins-i-caves-qr/?wpvproductcat=[wpv-taxonomy-slug]" role="button">[wpv-taxonomy-title]</a></div>
[/wpv-conditional]
[wpv-conditional if="( has_term('vins-i-caves', 'product_cat', null) ne '1' )"]
<div class= "espacio3 botonMenuCartaQR"><a href="../plats-i-begudes-qr/?wpvproductcat=[wpv-taxonomy-slug]" role="button">[wpv-taxonomy-title]</a></div>
[/wpv-conditional]

Any help? Thanks in advanced!

#2343871

My issue is resolved now. Thank you!