Skip Navigation

[Resolved] Conditional Statements

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

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

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 1 reply, has 2 voices.

Last updated by Nigel 6 years, 8 months ago.

Assisted by: Nigel.

Author
Posts
#628042

I have a image field set up which can be duplicated to create a set of images. I want an if statement so that if no images are uploaded then the gallery title will not appear.

Would you know how to do this?

#628237

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Jack

You need to check whether your image field is empty or not, as described here: https://toolset.com/documentation/user-guides/conditional-html-output-in-views/checking-fields-and-other-elements-for-emptynon-empty-values/

So for a repeating custom image field with a slug of 'slide' your condition would look something like this:

[wpv-conditional if="( $(wpcf-slide) ne '' )"]
We have slides
[/wpv-conditional]