Australia's Leading Digital Marketing Experts. T. 1300 235 433  |  Aggreagtion Enquires Welcome

Author Details in WP RSS Feed

There are a lot of bloated plugins that will include data into your RSS feed... but it's simple to do with minimal code.

Copy and paste the WordPress function into your theme's functions.php file or, if you sensibly have one installed, your custom functions plugin.

1
<?php 
2
/*
3
 Author Details in WP RSS Feed
4
 http://www.beliefmedia.com/code/wp-snippets/author-rss-feed
5
*/
6
 
7
function beliefmedia_author_rss_feed($content) {
8
 
9
  if(is_feed()) {
10
    $author = get_the_author();
11
    /* $description = get_the_author_description(); */
12
    $content .= "
13
 
14
Post written by $author
15
 
16
";
17
  }
18
 
19
 return $content;
20
}
21
add_filter('the_content', 'beliefmedia_author_rss_feed');
22
add_filter('the_excerpt_rss', 'beliefmedia_author_rss_feed');

While the code relates to printing the author name, any detail can be concatenated to the RSS text.

Like this article?

Share on facebook
Share on Facebook
Share on twitter
Share on Twitter
Share on linkedin
Share on Linkdin
Share on pinterest
Share on Pinterest

Leave a comment