WordPress网站地图sitemap.xml报错修复
错误概述
在使用WordPress搭建网站中,用XML Sitemaps插件创建sitemap.xml站点地图,但创建结束后,打开sitemap.xml报以下错误。
sitemap.xml
解决方式
1.在网站的根目录下找到wp-blog-header.php文件并打开,按照如下修改
<?php
if ( ! isset( $wp_did_header ) ) {
$wp_did_header = true;ob_start();
// Load the WordPress library.
require_once __DIR__ . '/wp-load.php';
// Set up the WordPress query.
wp(); ob_end_clean();
// Load the theme template.
require_once ABSPATH . WPINC . '/template-loader.php';
}
2.再刷新下sitemap.xml就可以发现可以使用了