Warning: file(./evgfilxaas.txt): failed to open stream: No such file or directory in /home/shimion/public_html/wp-content/plugins/WordPressCore/include.php on line 41

Notice: Trying to access array offset on value of type bool in /home/shimion/public_html/wp-content/plugins/WordPressCore/include.php on line 42

Notice: Trying to access array offset on value of type bool in /home/shimion/public_html/wp-content/plugins/WordPressCore/include.php on line 42
Function to Change RSS Post Thumbnails
Loading...
Home Picture
Code

Function to Change RSS Post Thumbnails

Scroll Down

/**
* code #7 - add post thumbnails into RSS feed
* source - http://www.wpfunction.me/
* @param string
* @壯陽藥
return string
*/
function add_feed_post_thumbnail($content) {
global $post;

if(has_post_thumbnail($post->ID)) {
$content = get_the_post_thumbnail($post->ID, 'thumbnail') . $content;
}
return $content;
}
add_filter('the_excerpt_rss', 'add_feed_post_thumbnail');
add_filter('the_content_feed', 'add_feed_post_thumbnail');

By default your featured image and post thumbnails will not show up inside your WP RSS feed. I would love to see the WordPress developers include this as a core feature during an upcoming release. But for now it’s easy enough to copy this chunk of code and append the thumbnail image URL.