An Interest In:
Web News this Week
- March 21, 2024
- March 20, 2024
- March 19, 2024
- March 18, 2024
- March 17, 2024
- March 16, 2024
- March 15, 2024
How to Add Featured Image in WordPress RSSFeed
Featured Image in WordPress RSSFeed. If you use an RSS feed on your WordPress website, you'll notice that the featured image isn't included in your RSS feed's posts by default. Having an RSS feed with images will enhance your syndication and may come in handy later because marketing tools like Mailup, Aweber, MailChimp use RSS feeds to create newsletters. RSS really means simple syndication.
In this brief guide, I will show you how to show your featured image in WordPress RSS feed using a plugin and without a plugin.
Featured Image in WordPress RSSFeed (Manually)
If you are familiar with modifying your functions.php
file, you can use the code below to display the prominent Featured images in your RSS feed.
- Login to your WordPress Dashboard.
- Go to Appearance >> Theme Editor.
- Click on function.php
- Add given code in the bottom of function.php file.
- That's All, Click on Update file.
You can also add this code by using FTP.
/** * Featured image to RSS Feed. */function featuredtoRSS($content) {global $post;if ( has_post_thumbnail( $post->ID ) ){$content = '<div>' . get_the_post_thumbnail( $post->ID, 'medium', array( 'style' => 'margin-bottom: 15px;' ) ) . '</div>' . $content;}return $content;}add_filter('the_excerpt_rss', 'featuredtoRSS');add_filter('the_content_feed', 'featuredtoRSS');
Copy the above code and paste it into your function.php file. If you don't know what you are doing with the function first make a backup.
I shared this post from Add Featured Image in WordPress RSSFeed you can read in detail from there. Also they have provided easy way by using a plugin.
If you have any question please discuss below help to improve. Thank you.
Original Link: https://dev.to/elinabey/how-to-add-featured-image-in-wordpress-rss-feed-1g0e
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To