Display Thumbnails In Excerpt-Only (Summary) Feed
-
I would like to include thumbnail images already defined for each post to also be used in my summary feeds. When searching for this modification on Google, many sites suggest the code below to add to the active theme’s functions.php file.
Well, it works in adding the thumbnail to the feed, but it also triggers a switch from summary to full entry for the feed. So the feeds would show thumbnail plus full entry with post images.
Any suggestions how to achieve thumbnails for excerpt-only (summary-only) feeds?
function do_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', 'do_post_thumbnail_feeds'); add_filter('the_content_feed', 'do_post_thumbnail_feeds');
- The topic ‘Display Thumbnails In Excerpt-Only (Summary) Feed’ is closed to new replies.