- WordPress 2.7 Cookbook
- Jean-Baptiste Jung
- 464字
- 2021-04-01 13:55:49
Integrating Feedburner feeds on your theme
Feedburner is a service that allows you to keep a count of the people who have subscribed for your RSS feed. Once you have created a Feedburner feed, you have to integrate it to your theme. In this recipe, we shall learn three different How to do it... sections to integrate the Feedburner feeds with your theme.

How to do it...
There are three methods of integrating the Feedburner with a theme. These methods have been explained in the following sections:
Let’s start with the manual way by carrying out the following steps:
- In order to integrate your Feedburner feeds, you can simply edit your theme files and replace the following line of code,
<?php bloginfo('rss2_url'); ?>
with your Feedburner URL. - Usually, the RSS feeds are called in the
header.php
file. Many themes also feature RSS links in thefooter.php
andsidebar.php
files. - If you're using a Mac or a Linux machine, you can find any RSS link featured on a theme by executing the following command in the theme directory:
find . -type f -print | xargs grep rss2_url
Thanks to open source, a WordPress plugin exists to help you with your Feedburner RSS feeds.
- This plugin that will help you with your Feedburner RSS is called FeedSmith and can be downloaded from the following link: http://blogs.feedburner.com/feedburner/archives/2007/10/the_feedsmith_plugin_newly_for.php
- Install and activate it, just like any other plugin.
How about a bit of WordPress hacking? It is easy to use the .htaccess
file to automatically redirect any RSS feed top your Feedburner feed.
- The
.htaccess
file is located at the root of your WordPress installation. This is a configuration file for the Apache web server. - While editing
.htaccess
, make sure to create a backup. If you make a mistake or typo in this file, your blog will stop functioning. However, if you create a backup, you can restore the backup file, in order to eliminate that problem. - Edit the
.htaccess
file and add the following code (make sure you have replaced my Feedburner feed URL by yours!):<IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{HTTP_USER_AGENT} !FeedBurner [NC] RewriteCond %{HTTP_USER_AGENT} !FeedValidator [NC] RewriteRule ^feed/?([_0-9a-z-]+)?/?$ http://feeds.feedburner.com/wprecipes [R=302,NC,L] </IfModule>
How it works...
Let's have a look at the function of the preceding code:
- First, we make sure that the
mod_rewrite.c
module is installed on the server. There's more than 90% of chance that it is installed, however, while developing you must keep in mind every rare possibility. - We need to make sure that the client user agent isn't the Feedburner itself, or the feed validator. We definitely don't want to redirect bots to our Feedburner feed URL, otherwise they'll be able to grab our new blog content!
- Finally, we shall use a rewrite rule that requests the server redirect any kind of feed URL to our feedburner URL.

- iOS應用逆向與安全之道
- 中文版After Effects 2021入門教程
- Flash CC從入門到精通
- 數碼攝影后期高手之路(第2版)
- AutoCAD 2014電氣設計從入門到精通
- 詳解AutoCAD 2022機械設計(第6版)
- 大規模組織DevOps實踐
- Excel數據管理:不加班的秘密
- 輕松玩轉3D One AI
- 中文版AutoCAD 2022從入門到精通
- 中文版3ds Max 2014-VRay效果圖制作完全自學教程
- Illustrator平面設計應用教程
- 夢幻森林Procreate童話風插畫繪制專業技法
- Oracle E/Business Suite R12 Supply Chain Management
- SolidWorks三維設計及工程圖速成