-
AuthorPosts
-
January 31, 2014 at 12:55 am #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?January 31, 2014 at 10:20 am #217345Hi 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,
PeterJanuary 31, 2014 at 10:23 am #217346Is there an specific place where to put it in the functions.php? at the end? or…where?
January 31, 2014 at 10:45 am #217359Hi!
Yes, insert it at the very bottom
Best regards,
PeterJanuary 31, 2014 at 1:42 pm #217417It 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..January 31, 2014 at 6:36 pm #217583I 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?February 1, 2014 at 9:16 am #217737Hi!
Afaik the excerpt itself does not support any images because wordpress strips all html tags (including images) from the excerpt text.
Best regards,
PeterFebruary 1, 2014 at 12:45 pm #218238Yes, 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.
February 1, 2014 at 6:06 pm #218270Hi!
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 -
AuthorPosts
- The topic ‘RSS without photos’ is closed to new replies.