wordpress的sitemap地图常见报错 (Error on line 1 at column 6: XML declaration allowed only at the start of the doc

WordPress程序报错的问题

报错代码如下:

This page contains the following errors:

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

sitemap报错的解决办法:

通常修改网站根目录的wp-blog-header.php文件即可。

本文件仅几行代码,修改为:

if ( !isset($wp_did_header) ) { 

	$wp_did_header = true; ob_start(); 

	// Load the WordPress library.
	require_once( dirname(__FILE__) . '/wp-load.php' ); ob_end_clean(); 

	// Set up the WordPress query.
	wp();

	// Load the theme template.
	require_once( ABSPATH . WPINC . '/template-loader.php' );}

wordpress的sitemap地图常见报错 (Error on line 1 at column 6: XML declaration allowed only at the start of the doc)

 对于这种问题大家并不陌生,小白一般会选择更换其它sitemap插件,对于wp大家可以自备两个sitemap插件,各取所长。

相关文章

我想将wordpress的默认接口路由改掉,愿意是默认的带一个 wp...
wordpress自定义分类法之后,我看到链接都自动在后面添加了一...
事情是这样的,我用 get_post_type 函数创建了一个自定义分类...
最近网站莫名其妙的被顶上了,过一个多小时,就注册一个账号...
最近服务器要到期了,就想着把网站转移到另外一台服务器,本...
今天在写wordpress的接口,然后碰到个奇怪的问题,怎么访问都...