Saltar navegación

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

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

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 -

Zona horaria del colaborador: Asia/Kolkata (GMT+05:30)

Este tema contiene 2 respuestas, tiene 2 mensajes.

Última actualización por geertV-3 4 years, 8 months ago.

Asistido por: Minesh.

Autor
Mensajes
#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
Colaborador

Idiomas: Inglés (English )

Zona horaria: 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!