移除WordPress 文章中自动添加的标签

2019年12月13日09:22:28 发表评论 热度280 ℃

在使用WordPress 编辑文章时,常常会遇到段落与段落间的行距太大,是因为WordPress 在文字段落与段落间,都会自动帮你前后加上< p >...< / p>这对标签。如果想要拿掉自动加上< p>< / p>的功能,可以通过functions.php这个文件添加如下代码实现:

  1. remove_filter (  'the_content' ,  'wpautop'  );

在编辑器按下[Enter]键,会自动帮你换行,这其实也是WordPress的一番好意。如果想要拿掉自动加上
的功能,可以通过functions.php这个文件添加如下代码实现:

  1. remove_filter (  'the_excerpt' ,  'wpautop'  );
本文最后更新于:2019-12-14 17:33
瓜皮猪

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: