CMS Scripts

How to Add Images to WordPress Feed

Add Images to WordPress Feed

Add Images to WordPress Feed. WordPress still does not offer the functionality to display the image of a post in the RSS feed. With this feature you can add images in your feed by adding this function to the functions.php template. Add Images to WordPress feed

File to edit: functions.php

PHP

1
2
3
4
5
6
7
8
9
function rss_post_thumbnail($content) {
global $post;
if(has_post_thumbnail($post->ID)) {
$content = get_the_post_thumbnail($post->ID) . $content;
}
return $content;
}
add_filter(‘the_excerpt_rss’, ‘rss_post_thumbnail’);
add_filter(‘the_content_feed’, ‘rss_post_thumbnail’);

About the author

Hamid Awan

Hamid Awan is a computer Geek, Internet Entrepreneur, Business Guy, Blogger and Digital Marketing Specialist. He also helps companies to grow their Online Business. At Tech Entires he writes about Money Making Ideas, Business, Android Apps, Blogging, WordPress, SEO, Technology and Computer Tips and Tricks. If you have any suggestion, you can contact us through our Contact Us Page

Leave a Comment