You could do it by adding an action to the hook ‘rss2_item’ like so:
add_action('rss2_item', function(){
global $post;
$output="";
$thumbnail_ID = get_post_thumbnail_id( $post->ID );
$thumbnail = wp_get_attachment_image_src($thumbnail_ID, 'thumbnail');
$output .= '<post-thumbnail>';
$output .= '<url>'. $thumbnail[0] .'</url>';
$output .= '<width>'. $thumbnail[1] .'</width>';
$output .= '<height>'. $thumbnail[2] .'</height>';
$output .= '</post-thumbnail>';
echo $output;
});
Related Posts:
- Display the first image from a post in RSS feed
- How do I remove featured images and captions from a wordpress RSS feed?
- How to grab first image attached to post and display in RSS feed?
- How to add featured image or custom field to xml feed?
- Getting images to show up in RSS Reader
- RSS/Atom feeds invalid, “Mismatched tag” errors
- How do you code a featured image into an XML as a jpg link, instead of using a data-id number?
- WordPress create custom XML RSS feed template
- Get featured image from post on RSS feed
- Fetching full size featured image to insert in RSS Feed
- How to have featured image show in standard RSS Widget
- How to import linked images and make them featured -> automagically
- Embedded Feed Update
- Feed RSS problem on WordPress, need it for Google News
- WordPress Feed Error [closed]
- How to get image title/alt attribute?
- Generate Thumbnails only for Featured Images
- Set Featured Image Front Frontend Form
- Cannot get add_feed to work
- Retrieve 1st image in post and set it as featured image, when post is saved/updated
- How can I generate a RSS feed based on a custom WP_Query?
- Set featured image for multiple posts
- RSS for Pages Instead of Posts?
- Custom RSS feed forces download
- Disable only the main feed?
- How to change _wp_attachment_metadata specific value in SQL?
- Add theme support for post thumbnails
- Autogenerated Thumbnail compression depending on size
- Watermark featured image as soon as it is set on post edit page
- how to change my child theme featured image dimensions?
- Facebook is only displaying preview thumbnails that are 100px from my posts?
- Featured image is not showing in wp-admin
- User facing form to upload image on wordpress
- Change the RSS feed image
- How to add more than one RSS Feed Link for wordpress
- Display Taxonomy Image on single.php
- Need to take the first image out of posts and set it as the featured image
- featured image metabox not showing on the default post types edit page
- Change featured image urls in database
- Get smaller size of image, get_the_post_thumbnail
- how improve website mainpage loading
- Add ![CDATA] to permalink rss
- Different thumbnail sizes
- Add post-thumbnail after first paragraph including the caption
- wordpress get_the_post_thumbnail can’t set size
- Showing Post ID on RSS
- How to print the thumbnail only if a post has a thumbnail
- Rewrite WordPress Standard Feed URL – /feed/ to feed.xml
- Single post layout based on featured image size
- Migrating problem – featured images
- custom rss templete
- Set Featured Image by URL Form Post
- Adding Images into API
- Stuck on save/upload featured images plugin
- adaptive featured images wordpress 4.4 grid
- ACF – Add/update featured image (for videos) by field [closed]
- Forcing a user to crop the featured image in a certain aspect ratio
- fetch_feed returning rss feeds on same server as empty
- Show last 2 image attachments from posts
- Set featured image from external URL
- Show Multiple Size URL of one Featured Image/Thumbnail?
- remove and disable image link in functions.php
- Get current post featured image ID
- Why does the_post_thumbnail output full sized images after activating post-thumbnails support?
- Add Image Size for Featured Image with Responsive Design
- Create an RSS feed of all posts
- Reply via email (mailto link) in RSS feed at the end of each post
- Pull through featured image in a custom menu
- How do I get posts where image is larger than…?
- Category page with thumb is ok but can’t do the same with tags
- Programmatically set thumbnail via URL using DOM and XPATH – Where to add ELSEIF
- Retrieve a post’s featured image with PHP outside of WordPress
- Better way to show Description and image Captions
- Different size thumbnails on home and single pages
- Next Prev Post link rendering current post thumbnail
- RSS feed widget for specific categories with latest posts?
- WordPress keeps truncating my feeds and I can’t stop it
- custom image size not being fetched
- Resizing images failing
- How to add a new thumbnail size only to a certain custom post type?
- Blog replace single post page featured image
- Change pubDate in rss feed in another format
- How to remove private posts from RSS feeds?
- How to automatically add first image of post as thumbnail?
- Remove Default Read More Link in Manual Excerpt RSS Feed
- How to convert feature image as background image
- Moving Featured Images
- How do I Get WordPress Featured image from Frontend
- Can I use wp_widget_rss_output to show my site’s feed in the dashboard?
- Featured Image, and Image in post
- Get Post thumbnail without width/height attribute
- if statement for featured images
- Thumbnail size according to width and height
- Add feed to a custom page
- How to read the contents of single post through RSS feed
- How to include Related Posts in WP RSS feed
- Source problem for children page image
- Fetch first image URL from post and set as featured image URL
- How to stop WordPress from creating native thumbnails?
- Hot to change resized image link on posts