Home › Forums › Add-ons › Repeater Field › Getting The First Two Rows of a Repeater and Then Outputting a Nested Repeater › Reply To: Getting The First Two Rows of a Repeater and Then Outputting a Nested Repeater
Edited: answered it yourself before I could finish typing. Sometimes typing it out does help. That’s how I do my thinking most of the time.
…..
Maybe this code for a nested repeater stripped of all the extra stuff will help.
if (have_rows('parent_repeater')) {
while (have_rows('parent_repeater')) {
the_row();
if (have_rows('nested_repeater')) {
while (have_rows('nested_repeater')) {
the_row();
$value = get_sub_field('sub_field_of_nested_repeater');
}
}
}
}
So basically you have two nested loops that are identical.
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.