Sorry for my English, I'm not a native speaker.
I tried to solve this problem for hours without any luck. The question looks like a duplicate of the questions asked earlier here in Stack Overflow, but none of the solutions found here helped me.
TinyMCE wraps everything you put inside p tags. I need to change the force_root_block tinymce parameter to prevent this, but I don't know how to achieve this in Wordpress.
I tried putting the found code here in my functions.php, but that didn't work. In addition, the problem does not revolve around wpautop. This is just a TinyMCE problem: it puts p tags as the default behavior because it needs a root block. In my case, I don’t need the root block, because the contents of the editor are just plain text, the root block of which is in my code template. The added p-tags just break my layout by putting unnecessary html elements.
I tried using the TinyMCE plugin that has this option:
Stop removing the <p> and <br /> tags when saving and show them in the Text editor
but if this check box is not selected, the effect of "cleansing" of all tags, even those that I intentionally use in the editor, occurs.
All I want to achieve is to prevent the editor from adding unwanted p-tags and, at the same time, support p tags that I intentionally use .
Is there a way to edit the TinyMCE forced_routine block parameter on Wordpress?
source
share