Home › Forums › General Issues › Image size for $last_row › Reply To: Image size for $last_row
Hi @artdivision
If you set the Return Value option to “Image Array”, You should be able to do it like this:
<?php
// get the image
$image = $last_row['Image'];
// get the medium image
$size = 'medium';
$medium = $image['sizes'][ $size ];
$width = $image['sizes'][ $size . '-width' ];
$height = $image['sizes'][ $size . '-height' ];
?>
<img src="<?php echo $medium; ?>" alt="<?php echo $last_row['Title']; ?>" width="<?php echo $width; ?>" height="<?php echo $height; ?>" >
This page should give you more idea about it: https://www.advancedcustomfields.com/resources/image/.
I hope this helps 🙂
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.