Support » Plugin: SVG Support » Fixing the XML issue

  • Resolved clussman

    (@clussman)


    I used the code in the link to enable SVG images on my site and they work without having an XML declaration at the top. Adobe exports without the XML line so this was a must have for me. Passing the info along so you can incorporate the code into your plugin or so people can add it to their theme’s functions.php file.

    Note this addresses the change in how mime types are added starting in v4.7.1 and works on the current version v5.0.3. So it should be an across-the-board fix.

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

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

    (@benbodhi)

    Thanks for sharing. This looks very similar to code in my plugin. I will have to have a deeper look.

    I use Adobe Illustrator and it saves SVG files with that declaration at the top… But maybe we use different settings.

    I’ll keep note of this for future reference while working on the plugin 🙂

    @benbodhi There are actually two ways to export a SVG in Illustrator:

    File > Save As… will save your SVG with the standard metadata information on the top (including the <svg>-line)
    File > Export > Export As… will save your SVG without the standard metadata information on the top.

    See this website for more information: https://css-tricks.com/illustrator-to-svg/

    File > Export > Export As… is considered the best choice when using SVG files for the web because they are pretty close to web-ready.

    • This reply was modified 9 months, 2 weeks ago by  mauri94.
    • This reply was modified 9 months, 2 weeks ago by  mauri94.
    Plugin Author Benbodhi

    (@benbodhi)

    Ah I see, gotcha. I always save as.

    Thanks for sharing.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Fixing the XML issue’ is closed to new replies.