Wordpress数据库中不显示P和br标记

时间:2016-09-21 12:43:28

标签: html wordpress

我已经安装了tinymce-advanced插件并点击在保存时停止删除p和br标签并在插件设置中显示在HTML编辑器中选项并保存它。我创建了一个帖子并将其发布。但是,当我在WordPress数据库上解雇查询时。它没有向我展示p和br标签。请帮助我进入这个?

1 个答案:

答案 0 :(得分:1)

这是我用来自定义配置TinyMCE的(简化版本):

function custom_tinymce_config( $init ) {
    // Don't remove line breaks
   $init['remove_linebreaks'] = false; 
   // Convert newline characters to BR tags
   $init['convert_newlines_to_brs'] = true; 
   // Do not remove redundant BR tags
   $init['remove_redundant_brs'] = false;

    // Pass $init back to WordPress
    return $init;
}
add_filter('tiny_mce_before_init', 'custom_tinymce_config');

请您在当前主题functions.php中添加上述代码吗?

使用TinyMCE configuration parameters,找到需要更改的内容。

相关问题