Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am trying to put in an SVG inside my post, but it seems WordPress removes the content.

e.g.

 <svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="190">
 <polygon points="100,10 40,180 190,60 10,60 160,180"
 style="fill:lime;stroke:purple;stroke-width:5;fill-rule:evenodd;">
 </svg>

Gets rendered to

 <svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="190"></svg>

Is it possible to do this without a plugin like raw_plugin

share|improve this question
    
Appearantly not. The content area of posts and pages gets thoroughly filtered. Depending on the context however, it would be simple to create custom post meta that renders whatever you like. –  Nathan Powell Apr 25 '13 at 4:59
    
I look forward to seeing an answer, HTML5 is totally not "here" yet. Native cross browser support for SVG is far from reality yet without using something like Raphael. raphaeljs.com –  user31045 Apr 25 '13 at 16:06
add comment

1 Answer

up vote 1 down vote accepted

According to this post, if you put all the svg block in one line, it will be rendered.

This should work:

<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="190"> <polygon points="100,10 40,180 190,60 10,60 160,180" style="fill:lime;stroke:purple;stroke-width:5;fill-rule:evenodd;"> </svg>
share|improve this answer
    
Link only answers are discouraged. If something happens to that link the answer becomes useless. Please try to make your answer here stand alone. –  s_ha_dum Oct 22 '13 at 22:09
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.