Created
January 28, 2014 20:21
-
-
Save emaildano/8675530 to your computer and use it in GitHub Desktop.
Get first image in ACF repeater field
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
<?php | |
$first_img = true; | |
while($first_img && has_sub_field('post_images')): ?> | |
<a href="<?php the_permalink(); ?>"> | |
<img class="img-responsive" src="<?php | |
$image = get_sub_field('image'); | |
echo $image['sizes']['blog-lg']; | |
?>" alt="<?php echo $image['alt']; ?>" /> | |
<?php $first_img = false; ?> | |
</a> | |
<?php endwhile; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment