Skip Navigation

[Resolved] Conditional shortcode on an image term field

This support ticket is created 4 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.

Our next available supporter will start replying to tickets in about 0.91 hours from now. Thank you for your understanding.

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: Africa/Casablanca (GMT+01:00)

This topic contains 1 reply, has 2 voices.

Last updated by Jamal 4 years ago.

Assisted by: Jamal.

Author
Posts
#1847345

Basically what I am trying to do is if an image is set it displays it (flag) if there is no image display it shows the taxonomy name instead.

Hmm tried but its not working:

[wpv-conditional if="( (empty($(wpcf-flag))) )"][wpv-taxonomy-title][/wpv-conditional]

Brings up the taxonomy title every time, maybe its because it doesn't know which taxonomy to look at the field in?

#1847357

I run a test on my local copy and I was able to display the taxonomy title when no flag is present with the following code:

[wpv-conditional if="( $(wpcf-flag) eq '' )"][wpv-taxonomy-title][/wpv-conditional]
[types termmeta='flag' title='%%TITLE%%' alt='%%ALT%%' size='custom' height='33' class='flag' resize='proportional'][/types] 

Note that I did not use two conditions because when the first conditional evaluate to false the second one will return an empty string. Check this screenshot hidden link