Quantcast
Viewing all articles
Browse latest Browse all 9

david.bailey on "Redirect Feeds to Feedbuner Without Any Plugin"

Drop this into your functions.php file:

// Redirect RSS to FeedBurner //

function diww_rss_feed_redirect() {
    global $feed;

    $new_feed = 'http://feeds.feedburner.com/wanderingbrit';

    if (!is_feed()) {
            return;
    }
    if (preg_match('/feedburner/i', $_SERVER['HTTP_USER_AGENT'])){
            return;
    }

    if ($feed != 'comments-rss2') {
            if (function_exists('status_header')) status_header( 302 );
            header("Location:" . $new_feed);
            header("HTTP/1.1 302 Temporary Redirect");
            exit();
    }
}

add_action('template_redirect', 'diww_rss_feed_redirect');

Viewing all articles
Browse latest Browse all 9

Trending Articles