利用Fix Rss Feeds插件修复WordPress的Feed显示错误,
利用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.
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' ); } ?>​
就可以了。
您可能感兴趣的文章:
- WordPress中使主题支持小工具以及添加插件启用函数
- 几个优化WordPress中JavaScript加载体验的插件介绍
- 在WordPress中使用wp-cron插件来设置定时任务
- 8个出色的WordPress SEO插件收集
- WordPress 插件——CoolCode使用方法与下载
- 详解WordPress中提醒安装插件以及隐藏插件的功能实现

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



PHP and Flutter are popular technologies for mobile development. Flutter excels in cross-platform capabilities, performance and user interface, and is suitable for applications that require high performance, cross-platform and customized UI. PHP is suitable for server-side applications with lower performance and not cross-platform.

You can easily modify your WordPress page width by editing your style.css file: Edit your style.css file and add .site-content { max-width: [your preferred width]; }. Edit [your preferred width] to set the page width. Save changes and clear cache (optional).

WordPress posts are stored in the /wp-content/uploads folder. This folder uses subfolders to categorize different types of uploads, including articles organized by year, month, and article ID. Article files are stored in plain text format (.txt), and the filename usually includes its ID and title.

Create a product page in WordPress: 1. Create the product (name, description, pictures); 2. Customize the page template (add title, description, pictures, buttons); 3. Enter product information (stock, size, weight); 4 . Create variations (different colors, sizes); 5. Set visibility (public or hidden); 6. Enable/disable comments; 7. Preview and publish the page.

WordPress template files are located in the /wp-content/themes/[theme name]/ directory. They are used to determine the appearance and functionality of the website, including header (header.php), footer (footer.php), main template (index.php), single article (single.php), page (page.php), Archive (archive.php), category (category.php), tag (tag.php), search (search.php) and 404 error page (404.php). By editing and modifying these files, you can customize the appearance of your WordPress website

Search for authors in WordPress: 1. Once logged in to your admin panel, navigate to Posts or Pages, enter the author name using the search bar, and select Author in Filters. 2. Other tips: Use wildcards to broaden your search, use operators to combine criteria, or enter author IDs to search for articles.

The most stable WordPress version is the latest version because it contains the latest security patches, performance enhancements, and introduces new features and improvements. In order to update to the latest version, log into your WordPress dashboard, go to the Updates page and click Update Now.

WordPress is developed using PHP language as its core programming language for handling database interactions, form processing, dynamic content generation, and user requests. PHP was chosen for reasons including cross-platform compatibility, ease of learning, active community, and rich library and frameworks. Apart from PHP, WordPress also uses languages like HTML, CSS, JavaScript, SQL, etc. to enhance its functionality.
