Created
July 18, 2011 12:49
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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