Skip to content

Instantly share code, notes, and snippets.

Created March 4, 2020 07:23
What would you like to do?
Add Featured Images to WordPress Feeds
function ww_rss_post_thumbnail($content) {
global $post;
if(has_post_thumbnail($post->ID)) {
$content = get_the_post_thumbnail($post->ID) . $content;
return $content;
add_filter('the_excerpt_rss', 'ww_rss_post_thumbnail');
add_filter('the_content_feed', 'ww_rss_post_thumbnail');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment