I have searched for adding featuring image to rss feed with no plug-in for WordPress. I have found some examples and applied how it was instructed. But All I have got now is nothing. Still can’t reach the image.
The last and the best (according to me) solution (as told here) I have found is adding the following code to current theme’s functions.php
function featured_image_in_feed( $content ) {
global $post;
if( is_feed() ) {
if ( has_post_thumbnail( $post->ID ) ){
$output = get_the_post_thumbnail( $post->ID, 'medium', array( 'style' => 'float:right; margin:0 0 10px 10px;' ) );
$content = $output . $content;
}
}
return $content;
}
add_filter( 'the_content', 'featured_image_in_feed' );
I have not seen any change. Is there something else to be done?
What I want to do is adding featuring image as another key in the XML. It would be easier to show it for my slider.