Last active
August 29, 2015 14:23
-
-
Save bibliofille/eb68f64bc5754b2c10f8 to your computer and use it in GitHub Desktop.
ACF image grid
This file contains 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 | |
if ( get_field('portfolio_images' ) ) : | |
while ( the_repeater_field( 'portfolio_images' ) ) : | |
$image = wp_get_attachment_image_src(get_sub_field('portfolio_image'), 'portfolio'); | |
// url = $image[0]; | |
// width = $image[1]; | |
// height = $image[2]; ?> | |
<div class="grid"> | |
<img src="<?php echo $image[0]; ?>" width="<?php echo $image[1]; ?>" height="<?php echo $image[2]; ?>" alt="<?php the_sub_field( 'title' ); ?>" class="gallery-item" /><br> | |
<a href="<?php the_sub_field( 'image_link' ); ?>"><?php the_sub_field( 'title' ); ?></a> | |
</div> | |
<?php endwhile; | |
endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment