Hi,
Does anyone know why my featured images have started appearing incorrectly?
I was adding products to my site with featured images yesterday, and the size of them was fine.
I'm not doing anything different today and it's changed.
Altering the image properties does nothing.
Any ideas?
Thanks!
KJ.
klevismiho
Member
Posted 1 year ago #
I don't know why, but I get the featured images links, then this link I'll add to an img tag, and put the width and height to the image, like this:
<?php
//get image url
$image_id = get_post_thumbnail_id();
$image_url = wp_get_attachment_image_src($image_id,'large');
$image_url = $image_url[0];
?>
<img src="<?php echo $image_url; ?>" width="100" height="100" />
So you will be sure that the image is of this size.
@KJS1982: Unless you provide a link to a page demonstrating the problem, no one will be able to offer much in the way of assistance.
@klevismiho: That's not how the core featured image functionality works.
klevismiho
Member
Posted 1 year ago #
Yes its true esmi, but it's a workaround.