Table of Contents
利用Fix Rss Feeds插件修复WordPress的Feed显示错误,
您可能感兴趣的文章:
Home php教程 php手册 利用Fix Rss Feeds插件修复WordPress的Feed显示错误,

利用Fix Rss Feeds插件修复WordPress的Feed显示错误,

Jun 13, 2016 am 08:48 AM
wordpress

利用Fix Rss Feeds插件修复WordPress的Feed显示错误,

今天突然有个网友留言说博客的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.

Copy after login

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,其实只需将这个文件改为:

<&#63;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' );
}
&#63;>&#8203;

Copy after login

就可以了。

您可能感兴趣的文章:

  • WordPress中使主题支持小工具以及添加插件启用函数
  • 几个优化WordPress中JavaScript加载体验的插件介绍
  • 在WordPress中使用wp-cron插件来设置定时任务
  • 8个出色的WordPress SEO插件收集
  • WordPress 插件——CoolCode使用方法与下载
  • 详解WordPress中提醒安装插件以及隐藏插件的功能实现
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1664
14
PHP Tutorial
1268
29
C# Tutorial
1248
24
How to adjust the wordpress article list How to adjust the wordpress article list Apr 20, 2025 am 10:48 AM

There are four ways to adjust the WordPress article list: use theme options, use plugins (such as Post Types Order, WP Post List, Boxy Stuff), use code (add settings in the functions.php file), or modify the WordPress database directly.

How to build a website for wordpress host How to build a website for wordpress host Apr 20, 2025 am 11:12 AM

To build a website using WordPress hosting, you need to: select a reliable hosting provider. Buy a domain name. Set up a WordPress hosting account. Select a topic. Add pages and articles. Install the plug-in. Customize your website. Publish your website.

How to change the head image of the wordpress theme How to change the head image of the wordpress theme Apr 20, 2025 am 10:00 AM

A step-by-step guide to replacing a header image of WordPress: Log in to the WordPress dashboard and navigate to Appearance &gt;Theme. Select the topic you want to edit and click Customize. Open the Theme Options panel and look for the Site Header or Header Image options. Click the Select Image button and upload a new head image. Crop the image and click Save and Crop. Click the Save and Publish button to update the changes.

What are the plugins for wordpress blocking ip What are the plugins for wordpress blocking ip Apr 20, 2025 am 08:27 AM

WordPress IP blocking plugin selection is crucial. The following types can be considered: based on .htaccess: efficient, but complex operation; database operation: flexible, but low efficiency; firewall: high security performance, but complex configuration; self-written: highest control, but requires more technical level.

How to view the front-end of WordPress How to view the front-end of WordPress Apr 20, 2025 am 10:30 AM

You can view the WordPress front-end by logging into the dashboard and switching to the View Sites tab; automate the viewing process with a headless browser; installing the WordPress plugin to preview the front-end within the dashboard; viewing the front-end via a local URL (if WordPress is set locally).

How to import the source code of wordpress How to import the source code of wordpress Apr 20, 2025 am 11:24 AM

Importing WordPress source code requires the following steps: Create a sub-theme for theme modification. Import the source code and overwrite the files in the sub-topic. Activate the sub-theme to make it effective. Test the changes to make sure everything works.

How to cancel the editing date of wordpress How to cancel the editing date of wordpress Apr 20, 2025 am 10:54 AM

WordPress editing dates can be canceled in three ways: 1. Install the Enable Post Date Disable plug-in; 2. Add code in the functions.php file; 3. Manually edit the post_modified column in the wp_posts table.

How to import wordpress templates How to import wordpress templates Apr 20, 2025 am 10:18 AM

WordPress templates quickly create professional websites. The steps to import a template include: select and download the template. Log in to the WordPress dashboard. Select Theme from the Appearance menu. Click "Add New Theme". Click "Upload topic" and select the downloaded template .zip file. Click "Install Now". Click the "Activate" button. Customize the templates through the Customize menu.

See all articles