Support » Plugin: SVG Support » SVGs not appearing anymore

  • Resolved Oli

    (@oliverjdb)


    Hi All.

    My SVGs used to load and the color used to adhere to the SVG css class I’ve created for blue, green and red icons.

    Now, however, the icons show up white, or don’t show at all.

    I use Elementor, but even on a page that’s not edited in Elementor (as in the case of the URL I’ve shared in this report), the icons are not working.

    The funny thing is… in my page previews (on an Elementor page), the plugin is correctly replacing the SVG file with the full svg code, but the live version of the same page isn’t working.

    Please help 🙂

    Here’s the link again: https://starsandcatz.com/svg-test-page/

    • This topic was modified 4 years, 6 months ago by Oli.

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Benbodhi

    (@benbodhi)

    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.

    Plugin Author Benbodhi

    (@benbodhi)

    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.

    Plugin Author Benbodhi

    (@benbodhi)

    Great news!
    Thanks for reporting back 🙂
    Glad you found the issue.

    anvithks

    (@anvithks)

    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!

    Plugin Author Benbodhi

    (@benbodhi)

    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/

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘SVGs not appearing anymore’ is closed to new replies.