Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #217231

    I’m using FeedBurner for subscriptions. If I send the entire post the e-mail sent by FeedBurner includes the feature image and any other image in the post. But If I send an excerpt it doesnt’ send any image.
    I’ve tried a solution given by Dude some months ago:
    // 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;
    }
    }
    I also tried changing the word “thumbnail” with “featured”.
    I tried inserting it at the begining of the functions.php and also at the very end. In both cases it didn’t send the image but it didn’t even send the text of the excerp.
    Any idea why it didn’t work?

    #217345

    Hi fjrichart!

    Use the “excerpt” option and use following code to include the featured image

    
    add_filter( 'the_excerpt_rss', 'inoplugs_insertThumbnailRSS' );
    add_filter( 'the_content_feed', 'inoplugs_insertThumbnailRSS' );
    function inoplugs_insertThumbnailRSS( $content ) {
    global $post;
    $img = get_the_post_thumbnail($post->ID, 'thumbnail');
    $content = '<div>' . $img . '</div>' . $content;
    return $content;
    }
    

    Best regards,
    Peter

    #217346

    Is there an specific place where to put it in the functions.php? at the end? or…where?

    #217359

    Hi!

    Yes, insert it at the very bottom

    Best regards,
    Peter

    #217417

    It didn’t work. It sends the text that is in the excerpt but no image.
    I’ve got :
    In Worpress->Settings =excerpt
    In FeedBurnber->Summary Burner= Activated (1000 characters)
    In the Post I’ve written a text in the excerpt which is sent correctly..

    #217583

    I deactivated the Summary Burner option in FeedBurner and now it works perfect.
    It sends the featured image and also an image that I’ve included in the excerpt. Great!
    But in case I only need the image of the excerpt and not the featured image, what should I change in the snippet you gave me?

    #217737

    Hi!

    Afaik the excerpt itself does not support any images because wordpress strips all html tags (including images) from the excerpt text.

    Best regards,
    Peter

    #218238

    Yes, that’s true but since I included the snippet to get the featured image if I add an image in the excerpt Feed Burner is sending both images the featured image and the one in the excerpt.

    #218270

    Hi!

    Strange – please try following code instead – it just uses one filter:

    
    add_filter( 'the_excerpt_rss', 'inoplugs_insertThumbnailRSS' );
    function inoplugs_insertThumbnailRSS( $content ) {
    global $post;
    $img = get_the_post_thumbnail($post->ID, 'thumbnail');
    $content = '<div>' . $img . '</div>' . $content;
    return $content;
    }
    

    Regards,
    Peter

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

You must be logged in to reply to this topic.