<?php
function ah_rss_post_thumbnail($content) {
global $post;
if(has_post_thumbnail($post->ID)) {
$content = '<p>' . get_the_post_thumbnail($post->ID) .
'</p>' . get_the_content();
}
return $content;
}
add_filter('the_excerpt_rss', 'ah_rss_post_thumbnail');
add_filter('the_content_feed', 'ah_rss_post_thumbnail');
If you’re using the standard WordPress feeds, you might have noticed already that the article images don’t show up in the feed.
1 Response
Write a comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.