Last active
October 9, 2016 16:28
-
-
Save Bobeta/8263b0d46aaf76c8b7df7d2ab20ae3f8 to your computer and use it in GitHub Desktop.
Show post thumbnails in WP 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 | |
// Put post thumbnails into rss feed | |
function wpfme_feed_post_thumbnail($content) { | |
global $post; | |
if(has_post_thumbnail($post->ID)) { | |
$content = '' . $content; | |
} | |
return $content; | |
} | |
add_filter('the_excerpt_rss', 'wpfme_feed_post_thumbnail'); | |
add_filter('the_content_feed', 'wpfme_feed_post_thumbnail'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment