Use the Fix Rss Feeds plugin to fix WordPress feed display errors, _PHP tutorial

WBOY
Release: 2016-07-12 09:02:33
Original
1150 people have browsed it

Use the Fix Rss Feeds plug-in to fix the WordPress feed display error.

Today, a netizen suddenly left a message saying that the blog’s feed was down. The symptoms are as follows:

Chrome opens the subscription page directly and displays the following:

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 Tip: This feed contains errors.

It has no effect after adding it and can be used normally.

Xianguo Reader can also be read, but the latest articles are not available.

I tried it with IE and it showed “Invalid content exists at the top level of the document.”

Looking at the source code, you can see the content after parsing the HTML format. This shows that there is no problem with the WordPress feed output. The problem lies in the format of a certain file. But it is more difficult to find which file is the problem. The solutions given online are roughly as follows:

Check whether there are extra carriage returns and line feeds at the top and bottom

1. Check the wp-config.php file to see if there is a carriage return character in the code outside the PHP body;

2. Same as above, check the wp-rss2.php and wp-atom.php files. If they have not been modified recently, you can skip them;

3. Same as above, detect the functions.php file;

4. Note that the feed is cached. After the modification is completed, post an article so that the WP program can rebuild the feed to see the effect;

5. If there are still errors, you can try to temporarily close all plug-ins, change themes, etc. to eliminate them one by one.

I have modified all the above files, but still have no clue. . So I installed a plug-in "Fix Rss Feeds", enabled it and fixed it. Moreover, even if you delete the plug-in after the repair, it will not rebound~

After researching this plug-in, it seems that it only modifies wp-blog-header.php in the WordPress root directory. In fact, you only need to change this file to:

<&#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

That’s it.

Articles you may be interested in:

  • Enabling themes to support widgets and adding plug-in enabling functions in WordPress
  • Introduction to several plug-ins that optimize the JavaScript loading experience in WordPress
  • Use wp-cron plug-in in WordPress to set up scheduled tasks
  • Collection of 8 excellent WordPress SEO plug-ins
  • WordPress plug-in - CoolCode usage and download
  • Detailed explanation of the functions of reminding to install plug-ins and hiding plug-ins in WordPress

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1084595.htmlTechArticleUse the Fix Rss Feeds plug-in to fix the WordPress feed display error. Today, a netizen suddenly left a message saying that the blog’s feed was down. , the symptoms are as follows: Chrome opens the subscription page directly and displays the following: ...
Related labels:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template