In this article, we will show you how you can add post thumbnails to your WordPress RSS feeds with a simple function. The sad truth is that even if you enable the post thumbnails, it will not show up in your RSS feeds. In our earlier tutorial, we showed you how you can add post thumbnails in WordPress. But we have a solution for that.
All you have to do is open your theme’s functions.php file and add the following code:
function rss_post_thumbnail($content) {
global $post;
if(has_post_thumbnail($post->ID)) {
$content = '<p>' . get_the_post_thumbnail($post->ID) .
'</p>' . get_the_content();
}
return $content;
}
add_filter('the_excerpt_rss', 'rss_post_thumbnail');
add_filter('the_content_feed', 'rss_post_thumbnail');
Feel free to style this however you like. Remember to activate WordPress post thumbnails using our main WordPress post thumbnail tutorial before adding it to your RSS.
Related Posts :
What's a Wordpress Theme Framework? Professionals, Cons, And Extra
In this article, we will do our best to answer questions like what is a WordPress theme framework, what type of theme frameworks exist, … Read More...
Why You Must Begin Building Your E-Mail List Immediately
When we talk with professional bloggers, not building an email list is the #1 mistake they admit. Ever since the launch of OptinMonster, w… Read More...
How To Create Invoices For Clients Using Wordpress
Even though there is a WordPress plugin for invoices, we recommend using a more intuitive solution called Freshbooks. In this article, we … Read More...
7 Things You Must Do Before Starting a WordPress Web Design Business
Thinking of starting a WordPress web design business Here are 7 things you must do to jump start your web design business.
1. Business … Read More...
How to Increased Email Subscribers by 600% with OptinMonster
By making one single change on the site, were able to increase our daily email signup rate to around 445 – 470 new subscribers per day. On… Read More...
0 Response to "How to Add Post Thumbnail to your WordPress RSS Feeds"
Post a Comment