明天忽然有个网友留言说博客的Feed挂了,症状如下:
Chrome间接关上订阅页面显示如下:
This page contains the following errors: error on line 1 at column 1: Document is empty Below is a rendering of the page up to the first error.
FeedDemon提醒:此Feed蕴含谬误。
增加后也没什么影响,能失常应用。
鲜果浏览器也可浏览,然而没有获取到**的文章。
用IE试了下,显示“文档顶层存在有效内容。”
查看源代码发现是能看到HTML格局解析后的内容,这阐明WordPress的Feed输入是没有成绩的,出成绩的在于某个文件的格局。不过要找到是哪个文件出成绩就比拟难了。网上给出的处理办法大抵都是这样的:
检测上、下能否有多余的回车、换行符号
1、检测 wp-config.php 文件,查看PHP主体之外的代码有无回车符;
2、同上,检测 wp-rss2.php,wp-atom.php文件,假如最近没修正过,可略过;
3、同上,检测 functions.php 文件;
4、留意 feed是有缓存的,在修正实现之后,发一篇文章,使WP顺序重建feed,从而查看成果;
5、若依然有错,能够尝试临时封闭一切插件,改换主题等一一扫除。
把上述文件都修正了个遍,还是没有眉目。。于是装了个插件“Fix Rss Feeds”,启用后修复一下就搞定了。而且修复之后把插件删了也不会反弹~
钻研了下这个插件,仿佛只是修正了WordPress根目录下的wp-blog-header.php,其实只要将这个文件改为:
<?php
/**
* Loads the WordPress environment and template.
*
* @package WordPress
*/
if ( !isset($wp_did_header) ) {
$wp_did_header = true;
ob_start(); //2010-09-18 gofunnow.com added, it will Fix rss feed error "Error on line 2: The processing instruction target matching "[xX][mM][lL]" is not allowed." while burn feed from feedburner.com
require_once( dirname(__FILE__) . '/wp-load.php' );
ob_end_clean(); //2010-09-18 gofunnow.com added, it will Fix rss feed error "Error on line 2: The processing instruction target matching "[xX][mM][lL]" is not allowed." while burn feed from feedburner.com
wp();
require_once( ABSPATH . WPINC . '/template-loader.php' );
}
?>
就能够了。
以上就是安达网络工作室关于《利用Fix Rss Feeds插件修复WordPress的Feed显示错误》的一些看法。更多内容请查看本栏目更多内容!
明天在网页上传图片到博客,后果提醒:“无奈将上传的文件挪动至 /home/wwwroot/wp-content/uploads/2013/”...
在主题的function.php文件中,能够找到形如如下内容的语句:复制代码代码如下:if ( function_exists(&lsquo...
WordPress菜单CSS类选项设置办法: 1、点开WordPress菜单设置页面右上角“显示选项”,勾选外面的...
get_header()(获取头部) 引入主题的头部模板,默许会引入以后主标题录里的 header.php 文件。假如指定了一...
home_url()(获取首页链接) ome_url() 函数用来获取 WordPress 的首页链接。 用法 home_url( $path, $sch...
调用网站最新文章: 复制代码代码如下:<?phpquery_posts('showposts=10&orderby=new'); //showposts=10示意...