D
D
Dmitry Buravtsov2016-02-02 18:16:59
css
Dmitry Buravtsov, 2016-02-02 18:16:59

How to embed independent html code in wordpress post?

You need to insert an independent html code into a post in Wordpress. And that for it it was possible to register styles. But the styles of the main site should not affect it.
For example:
You need to insert the layout of the feedback form into the post, as an example.
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
HAbRAhabp, 2016-02-02
@dima_bur

For example:

var context = $("#integrate")[0].contentWindow.document;
$("body", context).html("heloo!")

Paste anywhere on the site
<script>$("isolate").each(function ()
{
var content, context;
content = $(this).html();
$(this).html("<iframe style=\"border:none;\"></iframe>");
context = $("iframe", this)[0].contentWindow.document;
$("body", context).html(content);
})</script>

And to isolate code from other styles use
<isolate>your content</isolate>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question