Advertisement
borkolivic

Featured image in RSS feed

Jan 15th, 2018
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.34 KB | None | 0 0
  1. function imageinRSS($content) {
  2.    global $post;
  3. if ( has_post_thumbnail( $post->ID ) ){
  4. $content = '<div>' . get_the_post_thumbnail( $post->ID, 'medium', array( 'style' => 'margin-bottom: 15px;' ) ) . '</div>' . $content;
  5. }
  6. return $content;
  7. }
  8.  
  9. add_filter('the_excerpt_rss', 'imageinRSS');
  10. add_filter('the_content_feed', 'imageinRSS');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement