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主题的时候,由于菜单样式的要求我...
很多朋友在做wordpree主题制作的时候会经常遇到一个问题,那...
wordpress后台的模块很多,但并不是每个都经常用到。介绍几段...
从WordPress4.2版本开始,如果我们在MYSQL5.1版本数据中导出...
很多网友会遇到这样一个问题,就是WordPress网站上传图片、附...
对于经常要在文章中出现代码的IT相关博客,安装一个代码高亮...