Skip Navigation

[Resolved] Conditional using shortcode in if not working

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

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 5 replies, has 2 voices.

Last updated by chrisH-10 4 years ago.

Assisted by: Minesh.


Hi there, going by Shane's answer in the below should work.

[wpv-conditional if="( '[types field='index-description-2' output='raw' suppress_filters='true' item='$parent'][/types]' ne '' )"]index-description-2[/wpv-conditional]

The shortcode [types field='index-description-2' output='raw' suppress_filters='true' item='$parent'][/types] in the *if* works file by itself if I put it on the page.



Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

I do not know yet but from where you see that suppress_filters='true' attribute is available.

From the code you shared - it seems you are trying to get the value of some parent field? Can you please tell me your post-relationship structure and what field value you want to check?


I don't quite understand what you're trying to say in that sentence, but I tried without the suppress_filters='true' and that makes no difference.

The relationship is that there is a Page Template which references a View. The View iterates over child pages (WP page heirarchy). This View contains the conditional with the problem.



Languages: English (English )

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

As you mentioned with another ticket - indeed, it seems we have timezone difference.

Can you please share problem URL and access details where you have added the conditional statement so I can check whats going wrong there.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.


As reported on line 14 you will see the exact shortcode that is part of the if on line 15.
[types field='index-description-2' output='raw' suppress_filters='true' item='$parent'][/types]

On the front end you will see the successful output of line 14 as a chunk of text between tiles like this hidden link.

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