Skip to content

Instantly share code, notes, and snippets.

@billerickson
Created November 2, 2016 17:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save billerickson/e2e2f8a4bdf38e8e1efd71e319378c54 to your computer and use it in GitHub Desktop.
Save billerickson/e2e2f8a4bdf38e8e1efd71e319378c54 to your computer and use it in GitHub Desktop.
<?php
$repeater_key = 'be_images';
$sub_field_key = 'url';
$images = get_post_meta( get_the_ID(), $repeater_key, true );
if( $images ) {
for( $i = 0; $i < $images; $i++ ) {
$path = get_post_meta( get_the_ID(), $repeat_key . '_' . $i . '_' . $sub_field_key, true );
if( $path ) {
echo '<img src="' . esc_url( home_url( $path ) ) . '" />';
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment