Code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function post_thumbnail_in_feeds($content) { | |
global $post; | |
if(has_post_thumbnail($post->ID)) { | |
$content = '<div>' . get_the_post_thumbnail($post->ID) . '</div>' . $content; | |
} | |
return $content; | |
} | |
add_filter('the_excerpt_rss', 'post_thumbnail_in_feeds'); | |
add_filter('the_content_feed', 'post_thumbnail_in_feeds'); | |
?> |
Screen shot
Note
Description | functions.phpに追記。アイキャッチに登録した画像をRSSにも含める。 |
---|---|
WordPress Ver. | 3.3.1 |
Via | Show Post Thumbnails in Feeds |