Site logo

Archived topic

Problem in resizing featured images

5 replies · Started by Lucas on May 4, 2020

Viewing posts 1–6 of 6

Good night, I have a problem resizing the featured images of the blog.

On the "Media" page in WordPress Settings, the size of the thumbnails is set to 300x300, however they are being displayed twice as large in the featured images of the posts.

On the home page the featured images appear at 300x300 (or something), however when you open them with the right mouse button they show their true size: above 600x wide.

I was able to observe a strange detail: when I reduce the size of the thumbnails in "Media" to 150x150, the featured images start to be displayed in true size 300x300, instead of just being resized via CSS as before.

Hi there,

I think this is srcset doing its job.

If you right-click the image and "Inspect", you'll see srcset is listing out quite a few image sizes depending on the screen size.

So how do I load featured images with only 300px regardless of resolution?

You could disable srcset: add_filter( 'wp_calculate_image_srcset', '__return_false' );

Thank you very much, it really worked.

You're welcome :)

This archived topic is closed to new replies.