Wordpress RSS FEED开头空行导致错误的解决方案

来源:互联网 发布:局域网桌面直播软件 编辑:程序博客网 时间:2024/06/08 10:53

漢化版: http://xloli.net/html/201005/thread-886.html

This page contains the following errors:

error on line 2 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.

Solution

PHP also uses a similar notation: <?php … ?>. Note that the final php ?> should be omitted from all PHP code files—modules, includes, etc. The closing delimiter is optional in PHP (but not in XML), and removing it helps prevent unwanted white space at the end of files which can cause problems with your feeds.

Check your wp-rss2.php and wp-atom.php files for blank lines outside of <? and ?> bracketed sections.

Check your wp-config.php file for blank lines outside of <? and ?> bracketed sections.

Check your theme’s functions.php file for blank lines outside of <? and ?> bracketed sections.

One by one, disable plugins and revalidate until you isolate the one causing the problem.

原创粉丝点击