Picture tag only takes 1 image
-
Hi
First, thank for your plugin, it works well and do it as spected.
I have a site running with nginx. I’ve tried the try_files path but this leads to serve jpg url with webp content, like this one:
https://site.com/wp-content/uploads/2024/11/image.jpg content-type: image/webp; charset=utf-8
That rigth for a end user… but now I have a bunch of 404 errors in Google Search Console because Google bots tries urls that doesn’t exists:
https://site.com/wp-content/uploads/2024/11/image.webp
Then I tried to do it with the picture tag, but this only puts the big image image in the srcset, so only 1 image is used, don’t matter the screen size.<picture class="some-class"
decoding="async"
fetchpriority="high">
<source type="image/webp" srcset="https://site.com/wp-content/compressx-nextgen/uploads/2024/11/image-1024x667.jpg.webp"
sizes="(max-width: 1024px) 100vw, 1024px">
<img width="1024" height="667"
src="https://site.com/wp-content/uploads/2024/11/image-1024x667.jpg"
class="some-class" alt="ALT for the image"
decoding="async"
fetchpriority="high"
srcset="https://site.com/wp-content/uploads/2024/11/image-1024x667.jpg 1024w,
https://site.com/wp-content/uploads/2024/11/image-300x196.jpg 300w,
https://site.com/wp-content/uploads/2024/11/image-768x500.jpg 768w,
https://site.com/wp-content/uploads/2024/11/image.jpg 1200w"
sizes="(max-width: 1024px) 100vw, 1024px">
</picture>I think the plugin must create some like:
srcset="https://site.com/wp-content/uploads/2024/11/image-1024x667.jpg.webp 1024w,
https://site.com/wp-content/uploads/2024/11/image-300x196.jpg.webp 300w,
https://site.com/wp-content/uploads/2024/11/image-768x500.jpg.webp 768w,
https://site.com/wp-content/uploads/2024/11/image.jpg.webp 1200w"
sizes="(max-width: 1024px) 100vw, 1024px">
- You must be logged in to reply to this topic.