tommy soependi
asked 7 years ago

Hi,

I want to replace my default feed url /feed into custom URL of my feedburner, how can i do that?

1 Answers
DominicStaff
answered 7 years ago

Hi,
For those who prefer a function instead of a plugin, you can use the following code. It uses the feed_link action hook and replaces all instances of your default WordPress feed (rss, rss2, atom, and rdf). Rename the function and remember to replace the url with your Feedburner url.

// replace the default posts feed with feedburner
function appthemes_custom_rss_feed( $output, $feed ) {
    if ( strpos( $output, 'comments' ) )
        return $output;

    return esc_url( 'http://feeds.feedburner.com/AppThemes/' );
}
add_action( 'feed_link', 'appthemes_custom_rss_feed', 10, 2 );

Hope this helps !

soependi
replied 7 years ago

Hi Dominic,

Where should i put the code?

dominic Staff
replied 7 years ago

You can put this code in the functions.php file (\wp-content\themes\dw-focus)

Powered by DW Question & Answer Pro