For some reason my RSS feed is repeating the site title twice without a space, obviously quite annoying.
BlognameBlogname for example.
Is there any hook i can use to have a custom title for the RSS Feed?
So i could have a title ‘This is My RSS Feed for Blogname’ or anything i wanted?
Is this possible or am i stuck with the double name.
Thanks for any help.
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
Edited: Bad answer removed.
Here is the working code:
function custom_blogname_rss($val, $show) {
if( 'name' == $show )
$out = 'Custom Blog Name';
else
$out = $val;
return $out;
}
add_filter('bloginfo_rss','custom_blogname_rss', 10, 2);
Don’t forget to change Custom Blog Name to something useful.
Put that code into a plugin.
Method 2
You can use add_filter('wp_title_rss', 'custom_feed_title', 10, 2); to change the feed channel title
function custom_feed_title($title) {
return "THIS IS MY NEW FEED TITLE";
}
add_filter('wp_title_rss','custom_feed_title', 10, 2);
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0