Created
August 4, 2013 09:42
-
-
Save ovizii/6149884 to your computer and use it in GitHub Desktop.
Show Post Thumbnail in feeds
This file contains hidden or 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
| // show post thumbnails in feeds | |
| function diw_post_thumbnail_feeds($content) | |
| { | |
| global $post; | |
| if(has_post_thumbnail($post->ID)) | |
| { | |
| $content = '<div>' . get_the_post_thumbnail($post->ID) . '</div>' . $content; | |
| } | |
| return $content; | |
| } | |
| add_filter('the_excerpt_rss', 'diw_post_thumbnail_feeds'); | |
| add_filter('the_content_feed', 'diw_post_thumbnail_feeds'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment