Created
July 16, 2013 04:57
-
-
Save simonlk/6005895 to your computer and use it in GitHub Desktop.
ACF Repeater field usage in functions.php using hook
This file contains hidden or 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
/*========================================= | |
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