Skip to content

Instantly share code, notes, and snippets.

@simonlk
Created July 16, 2013 04:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simonlk/6005895 to your computer and use it in GitHub Desktop.
Save simonlk/6005895 to your computer and use it in GitHub Desktop.
ACF Repeater field usage in functions.php using hook
/*=========================================
ACF Repeater
======================================== */
add_action( 'woo_post_inside_after', 're_acf_repeater', 10); // hook is the first part
function re_acf_repeater () { ?>
<?php if(get_field('field_name')): ?>
<ul>
<?php while(has_sub_field('field_name')) { ?>
<li><?php the_sub_field('sub_field_name'); ?></li>
<?php } ?>
</ul>
<?php endif; ?>
<?php }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment