Sauter la navigation

[Résolu] Conditional shortcode on an image term field

This support ticket is created Il y a 4 années et 3 mois. 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: Africa/Casablanca (GMT+01:00)

Ce sujet contient 1 réponse, a 2 voix.

Dernière mise à jour par Jamal Il y a 4 années et 3 mois.

Assisté par: Jamal.

Auteur
Publications
#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 lien caché