Skip Navigation

[Resolved] Only show a field when the value is not 0

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

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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: Asia/Kolkata (GMT+05:30)

This topic contains 2 replies, has 2 voices.

Last updated by geertV-3 2 years, 7 months ago.

Assisted by: Minesh.

Author
Posts
#2162123

I have a field affiches and I only want to show the field when the value is not the numeric value 0. So the field is not empty but contains the value 0.

This is the code I use now

Affiches: [types field='affiches' output='raw' item='@mijn-promomateriaal.parent'][/types]<br>

Is there a way to not show the field when there is a "0" in the field.

Thanks
Koen

#2162137

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

You can use the [wpv-conditional] shortcode to display the content conditionally.

Can you please try to use the following code and try to resolve your issue:

[wpv-conditional if="( '[types field='affiches' output='raw' item='@mijn-promomateriaal.parent'][/types]' ne '0' )"]
  Affiches: [types field='affiches' output='raw' item='@mijn-promomateriaal.parent'][/types]<br>
[/wpv-conditional]
#2162221

My issue is resolved now. Thank you!

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