Skip to content

Instantly share code, notes, and snippets.

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 outbravedigital/24beee16c60c2212ad46 to your computer and use it in GitHub Desktop.
Save outbravedigital/24beee16c60c2212ad46 to your computer and use it in GitHub Desktop.
<?php
if( have_rows('acf_repeaterfield') ):
while ( have_rows('acf_repeaterfield') ) : the_row();
$imageID = get_sub_field('acf_subfield');
$image = wp_get_attachment_image_src( $imageID, 'full' );
$alt_text = get_post_meta($imageID , '_wp_attachment_image_alt', true);
?>
<img src="<?php echo $image[0]; ?>" alt="<?php echo $alt_text; ?>" class="port-img front" />
<?php
endwhile;
else :
// none
endif;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment