Skip Navigation

[Resuelto] Conditional in Content Template to check whether a WYSIWYG field is empty or not

This support ticket is created hace 2 años, 5 meses. 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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Hong_Kong (GMT+08:00)

This topic contains 3 respuestas, has 2 mensajes.

Last updated by Luo Yang hace 2 años, 5 meses.

Assigned support staff: Luo Yang.


Tell us what you are trying to do?
Show or hide some code based on whether or not a WYSIWYG field has any content in it

Is there any documentation that you are following?

What is the link to your site?
hidden link

In the example, the 'Reviews' header should be hidden because it's inside a conditional that checks whether the field 'Reviews' has any content. I have tried all the methods I can find but none of them work.



You can setup the wpv-conditional shortcode like this:

[wpv-conditional if="  ( ( $(wpcf-test-wy-1) ne '' ) ) " ]
<p>Not empty</p>

Please replace test-wy-1 with your custom WYSIWYG field slug.

More help:


Unfortunately that doesn't work 🙁

    [wpv-conditional if="( ( $(wpcf-reviews) ne '' ) ) "]
    <h3 class="reviewsheader">Reviews</h2>
    [types field='reviews'][/types]

still shows the H3 heading even when Reviews field is empty.


I have tried it in my localhost with fresh WP installation + the latest version of Toolset plugins, it works fine, please try these:
1) Make sure you are using the latest version of Toolset plugins, you can download them here:

2) In case it is a compatibility problem, please deactivate all other plugins, and switch to WordPress default theme 2021, deactivate all custom PHP/JS code snippets, and test again

3) Also check if there is any PHP/JS error in your website:

4) If the problem still persists, please provide database dump file(ZIP file) of your website, you can put the package files in your own google drive disk, share the link only, also point out the problem page URL, I need to test and debug it in my localhost, thanks