Conditional Fields in View – show if not empty

Fields can be hidden if they are empty as follows:

[wpv-if contact="wpcf-contact" evaluate="empty($contact)" condition="false"]
[types field="contact" class="" style=""][/types]
[/wpv-if]

Other conditional statements are detailed here:

http://wp-types.com/documentation/user-guides/conditional-html-output-in-views/

Useful example to show value if the field is not empty or a “NULL” string
[wpv-if framed="wpcf-framed" evaluate="($framed != 'NULL') AND (!empty($framed))"]
DO SOMETHING HERE
[/wpv-if]

Leave a Comment