Return to Snippet

Revision: 67358
at September 19, 2014 06:00 by chrisaiv


Updated Code
/** ******** ******** ******** ******** ******** ******** ******** ******** 
* Title:        Show Featured Images In Feed
* Description:  Same as above
* http://www.smashingmagazine.com/2011/12/07/10-tips-optimize-wordpress-theme/
* 
* 
*/

function rss_post_thumbnail($content) {
  global $post;
  if( has_post_thumbnail($post->ID) )
    $content = '<p>' . get_the_post_thumbnail($post->ID, 'thumbnail') . '</p>' . $content;
  return $content;
}
add_filter('the_content_feed', 'rss_post_thumbnail');

Revision: 67357
at September 13, 2014 10:16 by chrisaiv


Initial Code
/**
* Title: Show Featured Images In Feed
* 
* http://www.smashingmagazine.com/2011/12/07/10-tips-optimize-wordpress-theme/
* 
* 
*/

function rss_post_thumbnail($content) {
  global $post;
  if( has_post_thumbnail($post->ID) )
    $content = '<p>' . get_the_post_thumbnail($post->ID, 'thumbnail') . '</p>' . $content;
  return $content;
}
add_filter('the_content_feed', 'rss_post_thumbnail');

Initial URL
http://www.smashingmagazine.com/2011/12/07/10-tips-optimize-wordpress-theme/

Initial Description
To encourage subscribers to visit your website, rather than letting them just consume content through your RSS feed, you might want to display only the excerpt and featured image of posts.

Initial Title
Wordpress: Show Featured Images In Feed

Initial Tags
wordpress

Initial Language
PHP