admin管理员组文章数量:1122832
I have the old problem that the WordPress editor overwrites my HTML code. For example, the editor inserts <p>
and <br>
tags where you don't have them set.
The second problem is the editor doesn't show the real source code. If I write some code in the editor, and update, and look afterwards at the source code in the front-end (e.g. with Firefox), it shows there are tags which I can't see in the back-end editor.
To suppress the problem, I installed the TinyMCE A. Editor, but it doesn't always work. Why must I have an external editor to change it? Can't WordPress have it's own solution for this little bug?
I wish that WordPress would have the option to switch the Editor ON or OFF, so the user can choose. Some kind of solution might be a supplement in functions.php
, where you can add shortcodes; I think that is laborious, but could it be the real solution?
I have the old problem that the WordPress editor overwrites my HTML code. For example, the editor inserts <p>
and <br>
tags where you don't have them set.
The second problem is the editor doesn't show the real source code. If I write some code in the editor, and update, and look afterwards at the source code in the front-end (e.g. with Firefox), it shows there are tags which I can't see in the back-end editor.
To suppress the problem, I installed the TinyMCE A. Editor, but it doesn't always work. Why must I have an external editor to change it? Can't WordPress have it's own solution for this little bug?
I wish that WordPress would have the option to switch the Editor ON or OFF, so the user can choose. Some kind of solution might be a supplement in functions.php
, where you can add shortcodes; I think that is laborious, but could it be the real solution?
- Have you looked at this plugin?: wordpress.org/plugins/disable-visual-editor-wysiwyg – John Reid Commented Oct 15, 2014 at 12:18
- Thank you for answer.. but thats not my solution, I need the function visual editor too.. Only no overwrite!? :) – footer Commented Oct 15, 2014 at 12:28
1 Answer
Reset to default 0If you were always writing in HTML, you could add the following to your functions.php
file:
remove_filter( 'the_content', 'wpautop' );
remove_filter( 'the_excerpt', 'wpautop' );
I do this for some of my own sites.
As it sounds like you want the option to turn this on or off, you may want to try the wpautop control plugin.
This should let you turn it off on your posts, while leaving it on for other users.
本文标签: How to stop wpeditor() overwriting my HTML
版权声明:本文标题:How to stop wp-editor() overwriting my HTML? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736283085a1926851.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论