Support

Account

Home Forums Add-ons Repeater Field Show specific rows from repeater Reply To: Show specific rows from repeater

  • <?php
    $count = 0;
    $your_repeater = get_field('your_repeater');
    if($your_repeater){
       while( have_rows('your_repeater') ): the_row();
       $count++;
       $my_field = get_sub_field('my_field');
       echo '<div class="row">'.$my_field.'</div>';
       if ($count == 6) {
          echo '<div class="somecontent">getcontent6</div>';
       }
       if ($count == 12) {
          echo '<div class="somecontent">getcontent12</div>';
       }
       if ($count == 18) {
          echo '<div class="somecontent">getcontent18</div>';
       }
       if ($count == 24) {
          echo '<div class="somecontent">getcontent24</div>';
       }
    endwhile;  
    }
    ?>

    with that code every 6 row your additional row with content is added