Home › Forums › General Issues › Custom Image Sizes › Reply To: Custom Image Sizes
I followed instructions from Jonathan above but the code posted by Jonathan doesn’t work.
I set the image to Object in repeater field, this is my code:
$image_1 = get_sub_field('location_image');
<?php if($image_1): ?>
<img src="<?php echo $image_1['sizes']['medium']; ?>" style="max-width:300px;" alt="" />
<?php endif; ?>
when I remove
['sizes']['medium']
it works fine.
What’s the problem? Should there somewhere be [‘url’] added?
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.