当p标签首行缩进两格,此时br是不是仍顶格排版?整体看样子很不美观?小编给你一个良策,立马解决!
打开主题functions.php,最后一行添加以下代码:
/*br转换p*/
add_filter('the_content','brtop',999);
function brtop($content){
$content=preg_replace(array('/<br(.*?)>/'),array('</p><p>'),$content);
return $content;
}
/*/br转换p*/
添加文章,随便测试发布文章。现在好看多了吧?
评论(0)