Skip Navigation

[Resolved] Using post reference and how do i use IF-statments?

This support ticket is created 5 years, 5 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 1 reply, has 2 voices.

Last updated by Christian Cox 5 years, 5 months ago.

Assisted by: Christian Cox.

Author
Posts
#1320135

I am using post ref. and that works.
But how do i use conditionals and see if a value is empty ?

This is the value : [wpv-post-url item="@speeker.parent"]
Where do i add the "item" ?

[wpv-conditional if="( NOT(empty($(wpv-post-url))) )"]
Show this only if there is a value
[/wpv-conditional]

#1321351

Hi, the $() syntax is best for working with custom field values. In your case, it looks like you want to compare URLs. Am I correct? If so, then you can do something like this:

[wpv-conditional if="( NOT(empty( [wpv-post-url item='@speeker.parent'] )) )"]
Show this only if there is a value
[/wpv-conditional]

If that's not working as expected, please tell me the slugs of each post type and let me know which post type contains the post reference field.