Skip Navigation

[Resolved] conditional statements

This support ticket is created 4 years, 6 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
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 1 reply, has 2 voices.

Last updated by Shane 4 years, 6 months ago.

Assisted by: Shane.

Author
Posts
#1632265

Tell us what you are trying to do?
i am trying to set a conditional statement to show based of the view attribute I set up. but am having a hard time figuring out how to do this.

so in the view shortcode I set an attribute called "phone" and if the value is FALSE I do not want to show what is inside the conditional code block.

IF phone="false" do not show:
[types usermeta='phone-number'][/types]

Is there any documentation that you are following?

Is there a similar example that we can see?

What is the link to your site?

#1632405

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Jen,

Thank you for getting in touch. So you are writing the word "false" as the view shortcode attribute value correct?

If so then you can just use the conditional below.


[wpv-conditional if="('[wpv-attribute name='phone']' ne 'false' )"]

[types usermeta='phone-number'][/types]

[/wpv-conditional]

The above code will only display if the attribute value is not set to false.

Thanks,
Shane