我的博客提要今天显示错误:
此页面包含以下错误:
第 2 行第 6 列错误:仅允许在文档开头进行 XML 声明
下面是出现第一个错误之前的页面呈现
我的博客供稿:http://feeds.feedburner.com/klassicblog
我的博客:http://blog.klassicweb.com
这是我找到的解决方案
首先,您在 WordPress 根目录上创建一个包含以下内容的 php 文件 (whitespacefix.php)。
<?php
function ___wejns_wp_whitespace_fix($input) {
$allowed = false;
$found = false;
foreach (headers_list() as $header) {
if (preg_match("/^content-type:\\s+(text\\/|application\\/((xhtml|atom|rss)\\+xml|xml))/i", $header)) {
$allowed = true;
}
if (preg_match("/^content-type:\\s+/i", $header)) {
$found = true;
}
}
if ($allowed || !$found) {
return preg_replace("/\\A\\s*/m", "", $input);
} else {
return $input;
}
}
ob_start("___wejns_wp_whitespace_fix");
?>
然后打开index.php文件并在后面添加以下行<?php
tag
include('whitespacefix.php');
参考自here
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)