Support

Account

Home Forums General Issues Testing array values against Repeater fields Reply To: Testing array values against Repeater fields

  • dont use the_sub_field inside a “if-check” use get_sub_field instead.
    also dont use echo the_sub_field echo is not necessary there.
    because the_sub_field/the_field are functions that echo per se.
    and get_sub_field/get_field only get/check a value that need to be saved inside a variable for later using.

    try to use one of this codeparts instead of yours:

    if (get_sub_field('email_domain_name') == $dom) {
                    the_sub_field('email_domain_name');
                }
    $emaildom = get_sub_field('email_domain_name');
    if ($emaildom == $dom) {
                    echo $emaildom;
                }