Featured Image not included in article RSS Feed

Posted in: Newspaper
Post count: 42

Hi,
I encountered an issue in the last few days since I installed the Newspaper theme. The RSS Feed: https://www.teslaoracle.com/feed/

Due to the Featured Image is not included in the feed, services like Flipboard are loading the wrong image and that’s leading to problems in getting users to click on article links.

Please guide me ASAP.

Thanks!

Post count: 70

I had also faced this issue and I created this code. Note- use this code at your own responsibility.

// Add feature image to RSS
function add_rss_item_image() {
global $post;
if(has_post_thumbnail($post->ID))
{
$thumbnail_id = get_post_thumbnail_id($post->ID);
$thumbnail_url = wp_get_attachment_url($thumbnail_id);
$thumbnail = get_attachment_link(get_post_thumbnail_id($post->ID));
echo “\t<enclosure url=\”{$thumbnail_url}\” type=\”image/png\” />\n”;
}
}

Post count: 42

Thanks for the help, should I replace /png\ with /jpg\ if I have JPG featured images?

Post count: 30

What if I use webp images how can I use this code?

Post count: 30

Where should I put this code and also guide me if I use .web images?

Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic.