Support

Account

Home Forums General Issues Question regarding to Select

Unread

Question regarding to Select

  • Hi there,

    I have a question regarding Select with conditional.

    The example code given on the ACF website is

    if( get_field('question') == 'answer' ) {
        // Do something.
    }

    My question is how do I write the code to say if question 1 or question 2 is equal to ‘Yes’ and display the content?

    I wrote something like this but doesn’t seem working.

    if( get_field('question1') || get_field('question2') == 'yes' ) {
        // Show content here
    }

    Thank you in advance,

    Steve

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.