Home › Forums › Add-ons › Repeater Field › Repeater / Image Size Issue › Reply To: Repeater / Image Size Issue
I ended up using this code that works great:
$attachment_id = get_sub_field('gallery_image');
$size_thumb = "gallery-img"; // (thumbnail, medium, large, full or custom size)
$size_gallery = "full"; // (thumbnail, medium, large, full or custom size)
$image_thumb = wp_get_attachment_image_src( $attachment_id, $size_thumb );
$image_gallery = wp_get_attachment_image_src( $attachment_id, $size_gallery );
// url = $image[0];
// width = $image[1];
// height = $image[2]; ?>
<div class="gallery-img">
<img alt="Dance Avenue" src="<?php echo $image_thumb[0]; ?>" />
<div class="enlarge-img">
<?php
echo '<a class="fancybox" rel="group-'.get_the_ID().'" href="';
echo $image_gallery[0];
echo '">View Images</a>';
?>
</div>
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.