• Can I combine conditional logic statements?

    For example I want to show a widget on these product categories:

    is_product_category( array( ‘generators’, ‘portable-generators’, ‘standby-generators’ ) )

    But I also want to show on these product tags:

    is_product_tag( array( ‘honda-generators’, ‘honda-industrial-generators’, ‘briggs-stratton-generators’, ‘generac-generators’ ) )

    It works if I only list one of the conditional statements but pages get messed up if I enter both as:

    is_product_category( array( ‘generators’, ‘portable-generators’, ‘standby-generators’ ) )
    is_product_tag( array( ‘honda-generators’, ‘honda-industrial-generators’, ‘briggs-stratton-generators’, ‘generac-generators’ ) )

    I feel I am missing some simple bracket or semicolon somewhere to accomplish this.

    Any ideas?

Viewing 1 replies (of 1 total)
  • Try adding && between the conditionals like so:

    is_product_category( array( ‘generators’, ‘portable-generators’, ‘standby-generators’ ) ) && is_product_tag( array( ‘honda-generators’, ‘honda-industrial-generators’, ‘briggs-stratton-generators’, ‘generac-generators’ ) )
Viewing 1 replies (of 1 total)

The topic ‘Combine Conditional Logic Statements’ is closed to new replies.