Hi there,
Firstly, thanks for using my plugin 🙂
After looking at your site and the markup, it looks like there is something messing up there… did you change anything in particular? Updates or new plugins? So many things could be messing with that. Unfortunately, it’s outside of my plugin, so I don’t know what is happening exactly… but if the markup gets rendered correctly, my plugin will again swap out your SVG IMG tags with the inline SVG code.
Here’s a screenshot of the weird markup
You might have to do some troubleshooting… Try deactivating all other plugins and revert to twentynineteen theme. Test again… Then reactivate things one by one until you find the culprit. If you have trouble figuring out how/why once you find the culprit, let me know and I can try to help.
Regardless of outcome, let me know how you go. Seems like a weird one.
OH! I think I know what it is… Browsers just started supporting native lazyload… so images will start to lazyload by default. You will need to make sure to use the eager attribute on your img tags to make sure it is rendered early enough for my plugin to find it in the DOM and replace it with the actual SVG code.
So the IMG tag might look something like:
<img src="path/to/amazing-vector.svg" loading="eager" class="style-svg"/>
You can read more about native lazy loading here
Thread Starter
Oli
(@oliverjdb)
You’re actually correct on both fronts.
I use a plugin for speed optimisation called Autoptimize, it has a lazy loading option which I’ve been using.
I simply excluded .svg from lazy loading, and now it’s working perfectly again.
I hope this helps others with the same issue.
Thanks for your help.
Great news!
Thanks for reporting back 🙂
Glad you found the issue.
Just to add to this. I was facing similar issue with the Salient theme.
Posting here as I am not allowed to create a new thread.
I saw the same additional classes as in the screenshot.
I have the Smush plugin installed and I had to go and deactivate support for svg.
Works as expected now.
Thanks for this brilliant plugin!
Hi @anvithks
Thanks for your support and letting us know.
Strange you couldn’t start a new thread.
Please consider leaving a review 🙂
https://wordpress.org/support/plugin/svg-support/reviews/