Featured Images not feeding to RSS

Posted in: Newspaper
Post count: 15

Hi

We require a for the Newspaper theme. We use this theme on our website (https://www.indianlink.com.au/), and we use a simple app provided by AIM (https://www.thisisaim.com/) to deliver the articles of our website to our customers. The app can be found on the Apple or Play store and is called: Indian Link.

The app functions by pulling the Featured Image, Title, and Post content from a WordPress post using RSS, and delivering it to the app as an article to be tapped on. When tapped, the app diverts the user to the URL of that article.

We have discussed functionality with the app developer, and asked if any custom XML or PHP is required to make this function, but they have assured (and even showcased using a brand new WordPress installation), that the Featured Image, Title and Content pulls to the app without any additional plugins or changes to a standard WordPress installation.

Sadly, when the Newspaper theme is turned ON, the Title and the Content is pulled through, but the Featured Image is not. The image that appears in the app, is a default “fallback” image that has been set up in the AIM backend. If we turn the theme OFF, the featured images feed through to the app successfully.

At one stage, we had a programmer add this line of code to the bottom of the functions.php file, contained within: public_html/wp-content/themes/newspaper


// Add the 'media' namespace to the RSS feed
function custom_rss_namespace() {
echo 'xmlns:media=http://search.yahoo.com/mrss/ ';
}
add_action('rss2_ns', 'custom_rss_namespace');

// Add the media:thumbnail to the RSS feed
function custom_rss_media_thumbnail() {
global $post;
if (has_post_thumbnail($post->ID)) {
$thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'full');
$thumbnail_url = $thumbnail[0];
echo '<media:thumbnail url="' . esc_url($thumbnail_url) . '" />';
}
}
add_action('rss2_item', 'custom_rss_media_thumbnail');

It seemed to work, and the Featured Images began feeding correctly to the app. However as soon as there was a theme update, this file was overridden, and readding the same code did not result in the same outcome.

We’re in search of a permanent solution here, that would withstand future theme updates. I believe that there must be something in the Newspaper theme files that actively alters the original state of Featured Images, causing the app to not be able to find the image it is looking for when drawing from the RSS feed. If you use any online RSS viewer (example:https://rss.app/feed/y0F9FOXcarlvA9HX?utm_source=rssviewer&utm_medium=website), you will see that the featured images also do not appear.

Thank you in advance for your help!

Post count: 21065

Hello!

I will add it into our investigation list.

Thank you for your feedback!

Viewing 2 posts - 1 through 2 (of 2 total)
The forum ‘Newspaper’ is closed to new topics and replies.