今天发现sitemap xml地图插件,出现This page contains the following errors错误,这个插件我从几年前就开始用了,中间从来没出过问题,今天心血来潮想访问一下xml地图,结果出现如下错误:
![图片[1]-WordPress sitemap地图插件出现This page contains the following errors错误](https://www.umsbox.com/wp-content/uploads/2022/08/383c2dd4d3165435.png)
经过一番研究解决了这个错误,具体什么原因就不细说了,相信各位站长也不关心这个,我就直接给出解决方案。
$wp_did_header = true;
ob_start();
wp();
ob_end_clean();
<?php
/**
* Loads the WordPress environment and template.
*
* @package WordPress
*/
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';
}
此方法源于博主:龙飞瘦了!
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
暂无评论内容