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
Thanks John,
Think there were a couple of tiny typos but that works great. And I added my feeds_per_day variable in the for loop to show the right amount of meals. Perfect!
for ($i=1; $i<$feeds_per_day + 1; $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 echo more stuff ?></td></tr><?php
} // end while
} // end if meal
} // end for
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.