Home Forums Add-ons Repeater Field Pass Value to Nested Repeater Reply To: Pass Value to Nested Repeater

  • Solved it with this:

                      <?php if(get_field('faqs')): while(has_sub_field('faqs')): 				  
                      $variable = get_sub_field('category'); 			  
                      if(get_sub_field('qa')): while(has_sub_field('qa')): ?>
    					<article class="envor-sorting-item <?php echo $variable; ?>">
    						<header><?php the_sub_field('question'); ?> <i class="fa fa-plus"></i></header>
    						<?php the_sub_field('answer'); ?>
                      <?php endwhile; endif; 
                      endwhile; endif; ?>

    Not sure what I was doing wrong before!! Hopefully it helps someone else