Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #13922

    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!

    #81270

    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

    #81271

    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).

    #81272

    Thank you so much!

    It works perfectly, but I actually had to replace “thumbnail” with “featured” not “slideshow” :)

    feed://teo.is/feed/

    Thanks again!

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Featured Post Image in RSS feed’ is closed to new replies.