Wordpress WYSIWYG editor automatically adding span classes with style

情到浓时终转凉″ 提交于 2019-12-06 12:30:15
Christèle Legeard

I have the same problem, and I am not copying, each time I create a list, the editor adds in the code:

the text

to the text of the list.

How can I get rid of this ?


I have just find a solution that works for me in that post: http://wordpress.org/support/topic/strange-behaviour-making-lists-in-the-visual-editor

If you use a child theme, just add this function to your functions.php file:

 /**
 * I want to use the basic 2012 theme but don't want TinyMCE to create
 * unwanted HTML. By removing editor-style.css from the $editor_styles
 * global, this code effectively undoes the call to add_editor_style()
 */
add_action( 'after_setup_theme', 'foobar_setup', 11 );
function foobar_setup() {
  global $editor_styles;
  $editor_styles = array();
}

Are you copying and pasting the text from somewhere? Sometimes the text will have styles in its source and the styles get carried over to the wysiwyg. See http://tentblogger.com/copy-paste/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!