Skip to content

Instantly share code, notes, and snippets.

Created January 20, 2016 19:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/61b95f0a7999cb54f167 to your computer and use it in GitHub Desktop.
Save anonymous/61b95f0a7999cb54f167 to your computer and use it in GitHub Desktop.
<?php
// Beitragsbilder zu den RSS-Feeds hinzufügen
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');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment