Post Thumbnails im RSS Feed aktivieren


/ Published in: PHP
Save to your folder(s)

Code in functions.php einfügen


Copy this code and paste it in your HTML
  1. function rss_post_thumbnail($content) {
  2. global $post;
  3. if(has_post_thumbnail($post->ID)) {
  4. $content = '<p>' . get_the_post_thumbnail($post->ID) .
  5. '</p>' . get_the_content();
  6. }
  7. return $content;
  8. }
  9. add_filter('the_excerpt_rss', 'rss_post_thumbnail');
  10. add_filter('the_content_feed', 'rss_post_thumbnail');

URL: http://www.wpbeginner.com/wp-tutorials/25-extremely-useful-tricks-for-the-wordpress-functions-file/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.