• I’m wondering what PHP I could use to start each of my RSS feed’s items with the post’s author’s name?

    In other words, if a post title normally appears in the RSS feed as…

    Here’s a new post about WordPress

    …I’d like it instead to appear as…

    Author Name // Here’s a new post about WordPress

    I’m specifically avoiding adding the author name to the post title itself, so would prepending the author name in a feed item be accomplished with edits to feed.php? And if so, how?

Viewing 1 replies (of 1 total)
  • Thread Starter akwhitacre

    (@akwhitacre)

    Ah-ha, figured it out. Around line 114 in feed.php (in the wp-includes folder), change…

    function get_the_title_rss() {
    	$title = get_the_title();
    	$title = apply_filters('the_title_rss', $title);
    	return $title;
    }

    to…

    function get_the_title_rss() {
    	$author = get_the_author();
    	$author = apply_filters('the_author_rss', $author);
    	$title = get_the_title();
    	$title = apply_filters('the_title_rss', $title);
    	return $author . " // " . $title;
    }
Viewing 1 replies (of 1 total)
  • The topic ‘Starting RSS feed items with author name’ is closed to new replies.