Site logo

Archived topic

Responsive Featured Image

6 replies · Started by Tanya on March 6, 2018

Viewing posts 1–7 of 7

Hi,

I have set Featured Images on each page of my website.
I'd like to ensure these images are responsive.

Here is the code I'm using for some other images on the website. Where would I place similar code for the featured image? Thank you
<picture>
<source media="(min-width: 900px)" srcset=[122 size=large]>
<source media="(min-width: 465px)" srcset=[122 size=medium_large]>
[114]
</picture>

Hi Tanya,

WordPress featured images should be responsive by default - they use srcset. Is that not happening on your site?

Let me know :)

Hi Tom,
I am looking at Chrome Developer Tools - Network view.
Dev tools view

The top picture was taken when running in full screen mode. As you can see, images where I explicitly use srcset (in yellow) use large size (1024 width) and size in KB is reflected as large. See img_GM_11 (in red). This is the featured image. It is 696KB.

The bottom picture was taken when running within Iphone7 emulation. Images in yellow are smaller size, but image in red "img_GM_11" my header is still 696 KB.

I would expect the browser choosing a smaller version of the featured image for iPhone7.

Thanks Tom.

Optimizilla is an awesome suggestion. I was able to significantly shrink header image sizes without loosing in quality.

Thanks!

resolving the topic

Glad I could help! :)

This archived topic is closed to new replies.