修复 WordPress RSS 输出空行错误
  • 分类:PHP
  • 发表:2015-06-03
  • 围观(2,116)
  • 评论(0)

前几天有兄弟问我怎么博客好久不更新了,我说虽然更新的不勤快,但还是有更新啊。检查一下,发现原来是 WordPress 从去年开始输出的 RSS Feed 就出错了

This page contains the following errors:

error on line 3 at column 6: XML declaration allowed only at the start of the document Below is a rendering of the page up to the first error.

放狗一搜,貌似是 WordPress的普遍问题。

原因是 WordPress 输出 Feed 的时候,多加了一个空行。解决办法如下:

下载这个文件

wejnswpwhitespacefix

放心,没毒。解压后上传到 wordpress 根目录。

然后编辑 index.php,在最前面添加一行

//修复rss空行
include("wejnswpwhitespacefix.php");

保存上传。

然后重载你的 feed 页,好了。

参考

WordPress Remove Blank Line From RSS Feed – wordpress error on line 2 at column 6: XML declaration allowed only at the start of the document

共有 0 条评论

Top