Support

Account

Home Forums General Issues Loop through all rows of ACF group without specifying row name Reply To: Loop through all rows of ACF group without specifying row name

  • 
    for ($i=1; $i<7; $i++) {
      if (have_rows($meal.$i)) {
        while (have_rows('meal_'.$i) {
          the_row();
          
          // get sub fields and do calulations
          
          ?><tr><td>Meal <?php echo $i; ?></td><td><?php // your code continues...
        } // end while
      } // end if meal
    } // end for