Support

Account

Home Forums Add-ons Repeater Field Troubles with true/false in repeater Reply To: Troubles with true/false in repeater

  • i dont know if true/false has Problem with repeater.
    try if it works when you dont use == true, to ckeck if checked like that:

    if( get_sub_field ('show_desktop') ) {
    ...
    } else {
    ...
    }

    if this also dont work, you could try to replace true/false with a
    Radio Button or Check-Box field with value “yes” (and “no” when you use radio-button) and use code like that.

    $show_desktop = get_sub_field ('show_desktop');
    if ($show_desktop == 'yes'){
    ...
    } else {
    ...
    }

    of course you can replace yes/no with any value you wish when you use radio-button/check-box, just adapt code above