Support

Account

Home Forums Add-ons Repeater Field Loop Repeater Based on Sub Field Values Reply To: Loop Repeater Based on Sub Field Values

  • @chriswhiteley, the code posted by @bloodlvst should do what you want. Just change the field_name to the name of your repeater field and sub_field with your sub field name.

    and it will show every row with a value of functional assay if you want to only show the first one add a break; after the line the_sub_field('subfield');

    There is one error in the code

    
    <?php
    if(have_rows('field_name')):
       while(have_rows('field_name')): the_row();
          if(get_sub_field('sub_field') == 'functional assay'):
             the_sub_field('sub_field');
          endif;
       endwhile;
    endif;
    ?>