Skip to content

Instantly share code, notes, and snippets.

@aaronranard
Last active December 22, 2015 18:39
Show Gist options
  • Save aaronranard/6513969 to your computer and use it in GitHub Desktop.
Save aaronranard/6513969 to your computer and use it in GitHub Desktop.
WordPress: Repeater Field Loop
<?php if(have_rows('repeater_field_name')): ?>
<ul>
<?php while( have_rows('repeater_field_name')): the_row(); ?>
<li><?php echo get_sub_field('image'); ?></li>
<?php wp_reset_postdata(); // IMPORTANT - reset the $post object so the rest of the page works correctly ?>
<?php endwhile; ?>
</ul>
<?php endif; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment