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
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.