function the_row_index() { echo get_row_index(); }
the_row(); if (get_row_index() == 1) { ?> <div class="col-xs-6" style="background-color: <?php the_sub_field('color_item'); ?> "></div> <?php } } ?> <?php while (have_rows('color_boxes')) { the_row(); if (get_row_index() == $count) { ?> <div class="col-xs-6" style="background-color: <?php the_sub_field('color_item'); ?> "></div> <?php } } ?> </div> <div class="container res-box"> <div class="row"> <?php while (have_rows('color_boxes')) { the_row();