Support

Account

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 🙂