wordpress 4.2.1修复sitemap feed出现的错误,出现的错误如图:
出现这种情况,第一感觉就是wp-blog-header.php是不是错了?仔细观察原代码:
[php]
<?php
/**
* Loads the WordPress environment and template.
*
* @package WordPress
*/
if ( !isset($wp_did_header) ) {
$wp_did_header = true;
require_once( dirname(__FILE__) . ‘/wp-load.php’ );
wp();
require_once( ABSPATH . WPINC . ‘/template-loader.php’ );
}
[/php]
整个文件修改成如下:
[php]
<?php
/**
* Loads the WordPress environment and template.
*
* @package WordPress
*/
if ( !isset($wp_did_header) ) {
$wp_did_header = true;
ob_start();
require_once( dirname(__FILE__) . ‘/wp-load.php’ );
ob_end_clean();
wp();
require_once( ABSPATH . WPINC . ‘/template-loader.php’ );
}
?>
[/php]
问题解决。效果如:https://www.kejianet.cn/sitemap.xml