• Resolved bichant

    (@bichant)


    Hi Benbodhi,
    I’m not able to get my svg code to show inline. I inserted the svg using an img tag with loading=”eager” and class=”style-svg” as you instruct. And yes, I have advanced mode enabled. I have also deactivated all of my plugins, except SVG Support of course, without any luck.

    What else can I try? Could there be something in my .htaccess file or functions file that could be causing a problem?

    I’m trying to add GreenSock animations to my site so I need this to work.

    Thank you for your help and this great plugin!

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

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

    (@benbodhi)

    Hi there,

    Thanks for your support and choosing my plugin!

    So it looks like you have something deferring the script from my plugin that inlines the code…
    Screenshot: https://www.dropbox.com/s/oqzsn6cy2us94uh/Screenshot%202020-03-07%2009.48.29.png?dl=0

    There is a setting in my plugin to add the script to the header. That may work. Otherwise, you just need to make sure that whatever you’re using to defer the script avoids it. It has to load earlier to work.

    I hope this helps, please do let me know how you go.

    Thread Starter bichant

    (@bichant)

    I remembered I had put some code in my child themes .functions file to async javascript. I commented that out and it removed the async tag on the call to your javascript. It did not fix the problem.
    I use SG Optimizer plugin. It has a setting to async js. I excluded your file from that and even turned off that setting. It did not help.
    I use Cloudflare. I turned on Development Mode and turned off Rocketloader. It did not help.
    I have purged the cache in SG Optimizer, Cloudflare, and even cleared data from my browser. Still no inline code.
    Once again I deactivated all of my plugins except yours. Still nothing.

    I appreciate you taking the time to help me make this work.

    Plugin Author Benbodhi

    (@benbodhi)

    Hi there,

    Something you did made it work, the code is inline for me now:
    https://www.dropbox.com/s/lu2ke5nkpiv05o3/Screenshot%202020-03-08%2011.19.43.png?dl=0

    Thread Starter bichant

    (@bichant)

    Thank you for all your help Benbodhi.

    It’s very strange. It still doesn’t show in my WP code editor but it does show in the code when I look at it in developer tools. Probably a cache somewhere.

    It should work now though. Thank you for your help again. I’ll let you know if I have any more problems.

    Thread Starter bichant

    (@bichant)

    Still not working after clearing every cache I can find.
    I did a test. I set the target to opacity: 0.5 in my javascript file. It did not change the target in the img tag, but when I dropped the svg code directly into the page it showed up at 0.5 opacity.

    Plugin Author Benbodhi

    (@benbodhi)

    Hi there,

    The SVG code won’t show up in the backend. The way my plugin works is it finds the IMG tag with the target class in the markup during page rendering, it then switches that whole element with the SVG code itself.

    So, to make sure you can target the internal elements of your SVG with your JS file, you will need to make sure your JS fires after my plugin’s JS, otherwise it won’t work.

    Thread Starter bichant

    (@bichant)

    OK. Thank you for clearing that up for me. I wasn’t sure if the code actually showd up in the editor or not.

    Thank you again.

    Plugin Author Benbodhi

    (@benbodhi)

    My pleasure!

    Please consider leaving a review:
    https://wordpress.org/support/plugin/svg-support/reviews/

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘No Inline Code. Lazy Loading Fix Not Helping’ is closed to new replies.