Skip Navigation

[Resolved] Possible to do conditional: if custom field has more than x values, then…

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 7 years, 6 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

This topic contains 1 reply, has 1 voice.

Last updated by daveM 7 years, 6 months ago.

Author
Posts
#448118

I have a custom image field that allows multiple instances. I would like to do a conditional statement in one of my page templates with the following logic:

If wpcf_post_image_field has more than x items, then show this, else show this.

Is it possible to check the number of items in a custom field like this? If so, what's the best way to do it?

Thank you!

#448139

I figured out from one of my previous threads(https://toolset.com/forums/topic/possible-to-count-number-of-repeating-fields-with-echo-types_render_field/) that I need to use the global wpcf- prefix, I believe. And that fixed this problem.

The forum ‘Types Community Support’ is closed to new topics and replies.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.