0
因此,我正在使用feedburner作为我的提要,并使用该选项仅显示摘要/摘要的博客文章,唯一的问题是,使用此选项和而不是完整的帖子,它不会显示图片,该帖子的精选图片。如何在摘录Feed中显示thumnail图片/文章的精选图片
有没有一种方法可以做到这一点?
谢谢
因此,我正在使用feedburner作为我的提要,并使用该选项仅显示摘要/摘要的博客文章,唯一的问题是,使用此选项和而不是完整的帖子,它不会显示图片,该帖子的精选图片。如何在摘录Feed中显示thumnail图片/文章的精选图片
有没有一种方法可以做到这一点?
谢谢
您可以使用下面的示例代码中的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');
谢谢你的回答,但是这会得到从feedburner推进饲料?正如你所看到的,我已经在我使用http://bucatepealese.ro/feed这个主题的feed中提供了图片,但是如果我使用feedburner和excerpt选项,它不会显示任何图片。 – user3190197
是的,它也会显示在Feedburner的Feed中 – Akhilesh