Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // put this into functions.php
- add_filter('the_excerpt_rss','rss_filter') ;
- add_filter('the_content_feed','rss_filter_full') ;
- function rss_filter($content){
- global $post;
- $thumbId = get_post_thumbnail_id();
- if($thumbId) {
- $img = wp_get_attachment_image_src($thumbId, 'large');
- return '<img src="'.$img[0].'" alt="'.$post->post_excerpt.' title="'.$post->post_excerpt.'""/>'.$content;
- }
- }
- function rss_filter_full($content){
- global $post;
- $thumbId = get_post_thumbnail_id();
- if($thumbId) {
- $img = wp_get_attachment_image_src($thumbId, 'large');
- return '<img src="'.$img[0].'" alt="'.$post->post_excerpt.'" title="'.$post->post_excerpt.'"/>'.$content;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement