Hi and thanks for making such an awesome theme!
I was wondering if it's possible to add a featured image in my RSS by editing functions.php?
I tried with no success :(
Could you help me out please?
Thank you!
Hi and thanks for making such an awesome theme!
I was wondering if it's possible to add a featured image in my RSS by editing functions.php?
I tried with no success :(
Could you help me out please?
Thank you!
Hello,
I don't think that's possible because RSS feeds are outside the theme's control. I may be wrong so let me tag the rest of the support team.
Regards,
Ismael
Add following code to functions.php (add it to the very bottom):
// THIS INCLUDES THE THUMBNAIL IN OUR RSS FEED
add_filter( 'the_excerpt_rss', 'inoplugs_insertThumbnailRSS' );
add_filter( 'the_content_feed', 'inoplugs_insertThumbnailRSS' );
function inoplugs_insertThumbnailRSS( $content ) {
global $post;
$slides = avia_post_meta($post->post_id, 'slideshow');
if ($slides){
$postimage = avia_image_by_id($slides[0]['slideshow_image'],'thumbnail');
$content = '<div>' . $postimage . '</div>' . $content;
return $content;
}
}
You can replace 'slideshow' with any other thumbnail size (they're defined in functions.php at the top).
Thank you so much!
It works perfectly, but I actually had to replace "thumbnail" with "featured" not "slideshow" :)
Thanks again!
This topic has been closed to new replies.