Posted By

chrisaiv on 09/13/14


Tagged

wordpress


Versions (?)

Wordpress: Redirect WordPress Feeds To FeedBurner


 / Published in: PHP
 

URL: http://www.smashingmagazine.com/2011/12/07/10-tips-optimize-wordpress-theme/

If you want statistics about your subscribers, you’ll have to use FeedBurner instead of Wordpress' out-of-the-box feed.

  1. /** ******** ******** ******** ******** ******** ******** ******** ********
  2. * Title: Redirect Wordpress Feeds to Feedburner
  3. *
  4. * http://www.smashingmagazine.com/2011/12/07/10-tips-optimize-wordpress-theme/
  5. */
  6. function feed_to_feedburner_redirect() {
  7. if ( is_feed() && !preg_match('/feedburner|feedvalidator/i', $_SERVER['HTTP_USER_AGENT'])){
  8. header('Location: http://feeds.feedburner.com/[THE_NAME_OF_YOUR_FEED]');
  9. header('HTTP/1.1 302 Temporary Redirect');
  10. }
  11. }
  12. add_action('template_redirect', 'feed_to_feedburner_redirect');

Report this snippet  

You need to login to post a comment.