Created
October 15, 2015 21:02
-
-
Save thagxt/a6058b00881ecad3d745 to your computer and use it in GitHub Desktop.
Display WordPress' featured image in RSS feed
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
<?php | |
function FeatToRSS($content) { | |
global $post; | |
if ( has_post_thumbnail( $post->ID ) ){ | |
$content = '' . get_the_post_thumbnail( $post->ID, 'large', array( 'style' => 'max-width: 300px;' ) ) . '' . $content; | |
} | |
return $content; | |
} | |
add_filter('the_excerpt_rss', 'FeatToRSS'); | |
add_filter('the_content_feed', 'FeatToRSS'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment