• Hi everyone,
    i’m trying to use a svg file into a post but it doesn’t work, nothing appear! I tried to copy THE SAME CODE and paste into a html file (you can see it there http://studiodentisticocova.com/provadenti.html ) and everything works fine but NOT in my wordpress site (i can’t give you the link because it’s still il local).
    Anyone has an idea?
    Thanks!

Viewing 9 replies - 1 through 9 (of 9 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Thread Starter dborghez

    (@dborghez)

    That one no, but look at the red teeth, them are SVG!
    I think it’s a problem of the editor of wordpress, because if i try to copy the code from the page into my wordpress’ page with FIREBUG it works.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Oh I see, sorry.
    Could you copy all of your HTML (from the page’s source code) and paste it into a sandbox and share us a link to that?

    Thread Starter dborghez

    (@dborghez)

    here you can find the jsFiddle with the working code:
    jsFiddle

    I copied and paste that code into my wordpress’ page and the svg doesn’t work.
    Here you can find how it appear in firebug my wordpress’ page
    IMAGE

    Like you can see there isn’t any </svg> at the end and the syntax of the path it’s incorrect!

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    If it involves jQuery then you need to use a noconflict wrapper and you may need to enqueue your script.

    Btw it doesn’t look like the teeth are coloured on your JSfiddle page

    Thread Starter dborghez

    (@dborghez)

    It’s no a problem of jQuery because I’ve already solved that in wordpress πŸ˜‰
    I tried to change the color directly in svg file ( “fill:red” ) but nothing works. Truts me it’s a problem of the “pasting” code in wordpress editor, let me explain you why:
    1. I opened the external page ( PAGE ) and I analized it with firebug.
    2. I copied the code ( from firebug )
    3. I opened my wordpress page and analized it with firebug
    4. I pasted the part in my wordpress page, with FIREBUG and it works.

    Another example is this:
    I copied the code from HERE, pasted in my wordpress page and neither this was appeared!

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Could you post here the HTML output of your SVG code that is on your webpage?

    Thread Starter dborghez

    (@dborghez)

    HERE you can find the code that i copied. Like you can see there is a problem because there isn’t any </svg> and WordPress generate <p> and interpretates every <path> inside another <path>.

    i’m so sorry but i’m working in local so i can’t show you the code now πŸ™

    ps: I copied the code from Firebug

    I had the same problem, noticed WP was inserting
    most likely due to the copy and paste. I compressed the svg code w/ no unnecessary spaces and presto. In working order.

    Hope this helps.

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

The topic ‘SVG inline doesn't work’ is closed to new replies.