Created
January 26, 2016 03:49
-
-
Save dajocarter/75bbd83e609b5b8d1322 to your computer and use it in GitHub Desktop.
Example of using an Advanced Custom Field Repeater
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('field_name')) : ?> | |
<!-- This container is optional, yet usual --> | |
<ul id="repeater-container" class="container"> | |
<?php while (have_rows('field_name')) : the_row(); ?> | |
<!-- Place the markup you want to repeat here --> | |
<li class="repeated-item"> | |
<?php the_sub_field('sub_field_name'); ?> | |
</li> | |
<?php endwhile; ?> | |
</ul> | |
<?php endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment