• As always, this plugin is awesome, but always I need help in simple things …
    I got in admin a SELECT field with options A and B.
    I want to show in front end different but simple content depending on the selected option in admin:
    IF option selected “A” > ECHO “HELLO”
    IF option selected “B” > ECHO “BYE”
    IF option selected “C” > ECHO “EXMAPLE”

    But I can’t figure out how to do it.

    Please … can anybody help me with this?

    Thanks in advance!

    https://wordpress.org/plugins/types/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter masterbip

    (@masterbip)

    Please any help? I think it is really simple but I can’t achieve this!

    I have the same problem … I was trying to do

    $display = types_render_field(‘date-display’);
    if($display->content == ‘2’){
    echo ‘whatever’;
    }

    but it didn’t work, so I’m using this way it works perfectly

    $display = types_render_field(‘date-display’); //a select field
    if($display== ‘Year/Month’){ //write the option text as you set it
    echo ‘whatever’;
    }

    markor91’s solution is fine. Is there anything else I can help you with?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Select Field: if A echo "HELLO" if B echo "BYE"’ is closed to new replies.