Imagify + Lazy Load creates weird code in image’s src attribute
-
Images affected by Imagify plus a Lazy Load setting that’s turned on from my theme creates a strange code into the picture’s source srcset tag and at the image’s src tag as well. A link to the image with inspect code is here: https://ibb.co/PMg7n1L
A copy of the inspect code is below:
<picture class="attachment-medium_large size-medium_large" loading="lazy"> <source type="image/webp" data-srcset="https://testing.fidelityrealestate.com/wp-content/uploads/2021/03/Top-Golf-Courses-in-the-US-768x432.png.webp" srcset="data:image/svg+xml,%3Csvg%20viewBox%3D%220%200%20768%20432%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3C%2Fsvg%3E"> <img width="768" height="432" src="data:image/svg+xml,%3Csvg%20viewBox%3D%220%200%20768%20432%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3C%2Fsvg%3E" data-src="https://testing.fidelityrealestate.com/wp-content/uploads/2021/03/Top-Golf-Courses-in-the-US-768x432.png" alt="Top Golf Courses in the U.S." loading="lazy"> </picture>Imagify works just fine without the Lazy Load option on but I require that the lazy load option is turned on from my theme to decrease load times for the site.
Has anyone seen something similar or why the strange code would be generated in the srcset and src attributes?
Here are my settings for Imagify:
General
Optimization Level: Aggressive
Auto-Optimize images on uploadOptimization
Webp Format
Create webp versions of images: Checked
– Display images in webp format on the site: Checked
– – Use <picture> tags (preferred)
– – If you use a CDN, specify the URL: (blank)I’ve also thought about an option of turning off my site theme’s Lazy Load and have it be handled by another script or plugin so that it wouldn’t generate the code in the scr attributes.
Any help would be much appreciated.
The topic ‘Imagify + Lazy Load creates weird code in image’s src attribute’ is closed to new replies.