Support

Account

Home Forums Front-end Issues Outputting Repeating Fields outside the main loop Reply To: Outputting Repeating Fields outside the main loop

  • I got this to work simply by running a separate loop for the repeating fields like in the documentation.

    Not sure if it is inefficient code or not, but it works. Here is my code outside of my normal loop

    <?php 
    if(get_field('added_content')): while(the_repeater_field('added_content')): ?>
    	<div id="added_content" class="row" style="background:url(<?php the_sub_field('background_img');?>) no-repeat center center;background-attachment:fixed;background-size:cover;">
    	<div class="custom_content">
    		<?php the_sub_field('custom_content');?>
    	</div>
    	</div>
    <?php endwhile; endif;?>

    Thanks