I have an image that I uploaded via the WordPress media library…
I went into the media library, selected the image, and hit the EDIT IMAGE link. This brings up tools to CROP the image. So, I cropped the image, making it a horizontal image… see below:
I then clicked SAVE, and then clicked UPDATE, and returned to the post. I used my template to call the a ‘large’ version of the image into my page … but the cropping was gone!
$reci_img_id = get_field('recipe_img'); // This calls the image from the ACF plugin
$size = 'large';
$imagesrc = $reci_img_id['sizes'][ $size ];
<img src="<?php echo $imagesrc; ?>" class="reci-img" alt="<?php echo $reci_img_id['alt'] ?>" />
The image shows up, but at the original dimension ratio (uncropped) …
Can someone tell me how to get the image to show up correctly? Should I be calling the image in some other way? I don’t want to crop the image using CSS, because my editors wont understand why the image is cropping “differently” than the image looks in the administration. The media image sizes in my template are thumbnail, medium and large (and full). Any ideas how to get this to work?
Please help! Thanks!!!
‘large’,
I suspect this is a bug and I haven’t found a solution.
A work-around is to pull the ‘full’ size. Don’t worry about it being too large; with modern browsers and srset the correct resolution image will be delivered to the viewer’s browser.