Skip to content

Instantly share code, notes, and snippets.

@monoescape
Created June 7, 2015 09:24
Show Gist options
  • Save monoescape/5f972e4be7c04457f56d to your computer and use it in GitHub Desktop.
Save monoescape/5f972e4be7c04457f56d to your computer and use it in GitHub Desktop.
<div id="container">
<?php
$rows = get_field('repeater' ); // get all the rows
$first_row = $rows[0]; // get the first row
$first_row_image = $first_row['image_1']; // get the sub field value
$image_small = wp_get_attachment_image_src( $first_row_image, 'thumbnail' );
$image_full = wp_get_attachment_image_src( $first_row_image, 'full' );
?>
<a class="image-link" href="<?php echo $image_full[0]; ?>">
<img src="<?php echo $image_small[0]; ?>" width="<?php echo $image[1]; ?>" height="<?php echo $image[2]; ?>"/>
</a>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment