Skip to content

Instantly share code, notes, and snippets.

@billerickson
Created August 17, 2014 23:03
Show Gist options
  • Select an option

  • Save billerickson/98be4770b322d1832c9d to your computer and use it in GitHub Desktop.

Select an option

Save billerickson/98be4770b322d1832c9d to your computer and use it in GitHub Desktop.
Displaying repeating ACF fields without using ACF functions
<?php
$testimonials = get_post_meta( get_the_ID(), 'be_testimonial', true );
if( $testimonials ) {
echo '<div class="testimonials">';
for( $i = 0; $i < $testimonials; $i++ ) {
$content = get_post_meta( get_the_ID(), 'be_testimonial_' . $i . '_content', true );
if( $content )
echo '<div class="testimonial">' . wpautop( $content ) . '</div>';
}
echo '</div>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment