把网站从差劲的”我要安家”搬到”盘古”以后,将Wordpress升级到了2.3.3版。到今天无意中发现网站的Rss在Opera和Firefox中都无法解析,提示大意是XML解析错误。在FEED Validator网站上验证我的feed竟然无法通过,提示说Rss内容不在第一行,也就是说XML文件第一行是空行。

在Google上搜索了半天,最后在Wordpress论坛的一篇帖子上看到了这样一句话:

Have a look through your wp-config.php, plugins and/or your theme’s function.php files.

In all cases, there should be no spaces or blank lines before the opening <?php tag. Also in all cases there should be no spaces or blank lines after the final ?> as well.

检查你的wp-config.php、插件以及主题中的function.php文件。任何情况下,在开头的“<?php”标签以前,以及最后的“?>”标签以后,都不能有空格或者空行。

于是赶紧检查wp-config.php文件,果然,文件最后有两行空白行。删掉空行,上传文件,问题解决。FEED Validator检查通过:

Congratulations!

Valid Rss  This is a valid RSS feed.

  转载必须注明文章来源于技客乐趣,否则后果自负!

相关文章:

随机日志

随机文章:

    

    2 个评论 to “解决WordPress Rss解析错误”

    1. AvatarRyuuMouGen
      1

      郁闷。。咋不管用那。我显示的是
      XML error: Invalid document end at line 76, column 1

      Reply to this comment.
    2. Avatar
      2

      感谢啊。。我前面没有出错,但你最后一句FEED Validator检查 给了我启发

      Reply to this comment.

    喷喷口水

    尊姓大名

    电子邮箱 (不会被公开)

    网址

    XHTML: 你可以使用这些标记: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

    评论预览:

    Bad Behavior has blocked 1826 access attempts in the last 7 days.

    Copy Protected by Tech Tips's CopyProtect Wordpress Blogs.