WordPress: Include your featured post image in RSS feeds
If you want to see your featured post image in your feeds, and want them to appear when your share it in social sites, all you need is to include this code in your theme’s functions.php file:
// Featured image in RSS feeds add_filter('the_excerpt_rss', 'eg_insertthumbnailrss'); add_filter('the_content_feed', 'eg_insertthumbnailrss'); function eg_insertthumbnailrss($content) { global $post; if ( has_post_thumbnail( $post->ID )) { $content = "<p>" . get_the_post_thumbnail ( $post->ID, 'thumbnail' ) . "</p><br />" . $content; } return $content; }
If your post has thumbnail pictures, they will appear on the top in paragraph tags. You can change how you want to see it, by manipulation the $content part in the if ( has_post_thumbnail( $post->ID )) statement.
You can also change which post image size you’d like to see. WordPress comes with three sizes by default, and one selection for the full image (thumbnail, medium, large or full). Your theme can also assign its own post thumbnail image sizes. Look for add_image_size('post-image-name'); line in your functions.php, and check the name, if you want to use your theme’s thumbnails.
