Home › Forums › Add-ons › Repeater Field › Repeater within a repeater options page – grab data from first repeater loop › Reply To: Repeater within a repeater options page – grab data from first repeater loop
Hi @tdoc42
If you want to use it inside of the child repeater loop, then you need to put the terms in a variable first. It should be something like this:
while ( have_rows('documents2', 'option') ) : the_row();
if ( have_rows('document_pages') ) :
// get the terms and put it in a variable for later use
$terms = get_sub_field('document_category2');
while ( have_rows('document_pages') ) : the_row();
$post_object = get_sub_field('document_page');
if ($post_object->ID == $currentPageID) {
// you can use the $terms variable here
print_r($terms);
}
endwhile;
endif;
endwhile;
I hope this makes sense 🙂
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.