Home › Forums › General Issues › Post object in a repeater in a group › Reply To: Post object in a repeater in a group
// loop over group field
if (have_rows('testimonials')) {
// always true
while (have_rows('testimonials')) {
// always happens once
the_row();
// loop over the repeater
if (have_rows('testimonial_repeat')) {
while (have_rows('testimonial_repeat')) {
the_row();
// get repeater sub field
$post_object = get_sub_field('testimonial_object');
} // end while repeater has rows
} // end if repeater has rows
} // end while group field has rows
} // end if group field has rows
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.