Sorry for my english, I'm not a native speaker.
I've been trying to solve this problem for hours with no luck so far. The question looks like a duplicate of questions asked previously here on Stack Overflow, but none of the solutions found here worked for me.
TinyMCE wraps anything you put in there inside p tags. I need to change the forced_root_block setting of tinymce to prevent this but I have no idea on how to achieve that on Wordpress.
I tried putting the code found here in my functions.php, but It did not work. Also, the problem doesn't revolve around "wpautop". It's just a TinyMCE problem: it puts the p tags as a default behaviour because it needs a root block. In my case I don't need a root block, because the editor's content is just a plain text whose root block is in my template's code. The added p tags simply break my layout, putting unnecessary html elements.
I tried using the TinyMCE advaced plugin, which has this option:
Stop removing the <p> and <br /> tags when saving and show them in the Text editor
but when this is not checked has the effect of "stripping" all the p tags, even the ones I intentionally use in the editor.
All I want to achieve is to prevent the editor from adding unwanted p tags and, at the same time, keep the p tags I intentionally use.
Is there a way to edit the forced_root_block setting of TinyMCE on Wordpress?
<br />
instead of a new paragraph? – vard