2014-02-17 50 views

回答

0

您可以使用下面的示例代码中的functions.php中摘录饲料

//Function to add featured image in RSS feeds 
function featured_image_in_rss($content){ 
    global $post; 
    if (has_post_thumbnail($post->ID)){ 
     $content = '<div class="featured_image_post_rss">' . get_the_post_thumbnail($post->ID, 'medium', array('style' => 'margin:10px; text-align: center;')) . '</div>' . $content; 
    } 
    return $content; 
} 

//Add the filter for RSS feeds Excerpt 
add_filter('the_excerpt_rss', 'featured_image_in_rss'); 

此外,如果你想特色图片添加到内容饲料,以显示特色图片,除了上面的代码外,还要添加下面的过滤器。

//Add the filter for RSS feed content 
add_filter('the_content_feed', 'featured_image_in_rss'); 
+0

谢谢你的回答,但是这会得到从feedburner推进饲料?正如你所看到的,我已经在我使用http://bucatepealese.ro/feed这个主题的feed中提供了图片,但是如果我使用feedburner和excerpt选项,它不会显示任何图片。 – user3190197

+0

是的,它也会显示在Feedburner的Feed中 – Akhilesh

相关问题