Last active
December 22, 2015 18:39
-
-
Save aaronranard/6513969 to your computer and use it in GitHub Desktop.
WordPress: Repeater Field Loop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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