Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save scottmatthewman/1089421 to your computer and use it in GitHub Desktop.
Save scottmatthewman/1089421 to your computer and use it in GitHub Desktop.
An example of how to tweak WordPress's RSS feed to prefix the title with the relevant post format ('Aside', 'Gallery', 'Video', etc.). Add to functions.php
function add_post_format_to_title_rss( $title )
{
$post_format = get_post_format();
if( false === $post_format )
return $title;
else {
$format_name = get_post_format_string($post_format);
return "{$format_name}: {$title}";
}
}
add_filter( 'the_title_rss', 'add_post_format_to_title_rss' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment