OR statement | WordPress.org

[ad_1]

Hello @sajtfokus

Thank you very much for using our plugin.

If you embed block/endblock tags you would be implementing an “and” operator:


<%fieldname1_block if_value_like={{apple}}%>
<%fieldname2_block if_value_like={{orange}}%>
some text
<%fieldname2_endblock%>
<%fieldname1_endblock%>

There are two possible solutions to implement an “or”:

  • You can insert a calculated field in the form to be used as an auxiliary (you can hide it by ticking a checkbox in its settings), and enter the equation:
IF(OR(fieldname1 == 'apple', fieldname2 == 'orange'), 1, 0)

And use the block tags:


<%fieldname3_block if_value_is={{1}}%>
some text
<%fieldname3_endblock%>
  • The second alternative requires to duplicate blocks:

<%fieldname1_block if_value_like={{apple}}%>
some text
<%fieldname1_endblock%>
<%fieldname1_block if_value_unlike={{apple}}%>
<%fieldname2_block if_value_like={{orange}}%>
some text
<%fieldname2_endblock%>
<%fieldname1_endblock%>

The previous structure prevents repeating the “some text” text.

Best regards.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer