Snippi
A super awesome snippet tool.
- 1.
function insertThumbnailRSS($content) { - 2.
global $post; - 3.
- 4.
if( get_post_type() == 'post' ){ - 5.
if ( has_post_thumbnail( $post->ID ) ){ - 6.
$content = '' . get_the_post_thumbnail( $post->ID, 'thumbnail' ) . '' . $content; - 7.
} - 8.
} - 9.
else if( get_post_type() == 'portfolio' ){ - 10.
$thumbID = get_post_meta( $post->ID, '_prime_portfolio_thumbnail_id', true); - 11.
- 12.
if( $thumbID != "" && prime_check_file_exists( $thumbID ) ){ - 13.
$tUrl = wp_get_attachment_image_src($thumbID, 'thumbnail', false); - 14.
- 15.
if( isset( $tUrl[0] ) ) $content = '<img src="' . $tUrl[0] . '" alt="" />' . $content; - 16.
} - 17.
} - 18.
return $content; - 19.
} - 20.
- 21.
add_filter('the_excerpt_rss', 'insertThumbnailRSS'); - 22.
add_filter('the_content_feed', 'insertThumbnailRSS');