Blog RSS Featured Image

Hi there,

 

I was wondering if there is a reason why the RSS feeds for blogs don't include the featured image for a post? We're using the RSS feed to generate emails using Digesto and it's become a pain point that we can't access the images that we upload for each post.

 

I'd imagine it could print out something like this, probably fairly easy to add to the feed as well because I'm guessing Hubspot has it developed in a way they can access the post data as an object.

 

<image>http://image-source-here.jpg</image>

Thanks!

Sean

HubSpot updates
25 Replies
Occasional Contributor

 

 

Sure @suryast - it's an external site but maybe someone will find it useful.

 

I looked at a hubspot feed (blog.hubspot.com/rss.xml) and made an identical feed on my site:

 

hubspot's bloghubspot's blogmy markupmy markup

 

custom rss feed output to match hubspotcustom rss feed output to match hubspot

 

 

New Contributor

Sorry to say @jlamb2's solution didn't work for me. But for those who are using WordPress, I found a solution. The HubL template code is capable of picking up the comments link from the RSS feed. So I changed our RSS feed to use the url to the featured image instead of the comments. This solution is good only if you don't care that the comments links in your feed link to the featured image instead of the comments.

 

You can insert this code into your theme's functions.php file:

 

add_action('comments_link_feed', 'change_comments_link_feed');
function change_comments_link_feed() {
  global $post;
  if(has_post_thumbnail($post->ID)):
    $thumbnail = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );
    return($thumbnail);
  endif;
}

Then in your email template, you can use post.comment_url to get the image url:

<img src="{{ post.comment_url }}" width="100%">

 

Occasional Contributor

HubSpot, are you going to chime in here? It's pretty crazy that you're not adding functionality for featured images in RSS feed emails. Users have been asking for this for YEARS.

New Contributor

Has there been a solution to this? We would really like to our featured image to pull through into the RSS feed on our WordPress site. It is frustrating that this detail, which seems to be extremely desired and popular, has not been addressed. 

New Contributor

Has this been added yet?