最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

tinymce - WordPress removes paragraphs. How to disable this behavior?

programmeradmin0浏览0评论

For example, this code:

<div><p>Some text here</p></div>

Becomes formatted as this:

<div>Some text here</div>

I think that this is MCE related behavior, because when I switch to visual editor and back to code editor all "p" tags disappear. How to disable it? Thank you!

For example, this code:

<div><p>Some text here</p></div>

Becomes formatted as this:

<div>Some text here</div>

I think that this is MCE related behavior, because when I switch to visual editor and back to code editor all "p" tags disappear. How to disable it? Thank you!

Share Improve this question edited Oct 22, 2019 at 14:09 butlerblog 5,1213 gold badges28 silver badges44 bronze badges asked Oct 22, 2019 at 8:47 Andrei PavlenkoAndrei Pavlenko 11 bronze badge
Add a comment  | 

1 Answer 1

Reset to default -1

check this solution help full for you.

jQuery(document).ready(function(){

var a = $('div').html();

$('div').html('<p>'+a+'</p>');

});

or check this url link

发布评论

评论列表(0)

  1. 暂无评论