You may occasionally see duplicate images in blog posts added via a third-party RSS feed using the RSS Subscription settings. This typically happens because many third-party feeds do not include a featured image. To compensate, the system pulls an image from the blog description to generate a featured image.
However, if the feed already includes a featured image tag, both the featured image and the image from the description can appear in the post, resulting in duplicate images.
Add the following JavaScript to your Blog Category Custom Header HTML. This script automatically removes any in-article image that matches the featured image, preventing duplicates.
<script>
$(document).ready(function() {
let featuredImg = $('.content-header .media-container img').attr('src');
$('article img').each(function() {
if ($(this).attr('src') == featuredImg) {
$(this).remove();
}
});
});
</script>
After adding this script, your blog posts will display only one instance of the image, ensuring a cleaner and more professional appearance.