it_*_*ure 6 wordpress linefeed
我发现我的wordpress4.7中的CJK文章不能正确地破坏行,它包含CJK和英文字符.
这是发布前的文章.
在发布之前,所有的线都正确地断开了.
现在发布后显示如下.所有线条混乱,以意想不到的方式打破了格式错误.
我试过这样修理它.
vim /var/www/html/wp/wp-content/themes/twentysixteen/style.css
.site-inner {
margin: 0 auto;
max-width: 1320px;
position: relative;
}
.site-content {
word-wrap: break-word;overflow:hidden;
word-break:break-all;white-space:pre-wrap;
}
Run Code Online (Sandbox Code Playgroud)
要重新启动apache和wordpress,根本没有效果.
我的wordpress版本是4.7,主题是二十几岁.
小智 2
尝试将此代码添加到您的functions.php主题文件中
function my_tinymce_fix( $init )
{
// html elements being stripped
$init['extended_valid_elements'] = 'div[*], article[*]';
// don't remove line breaks
$init['remove_linebreaks'] = false;
// convert newline characters to BR
$init['convert_newlines_to_brs'] = true;
// don't remove redundant BR
$init['remove_redundant_brs'] = false;
// pass back to wordpress
return $init;
}
add_filter('tiny_mce_before_init', 'my_tiny_mce_fix');
Run Code Online (Sandbox Code Playgroud)