Created
December 13, 2017 15:44
-
-
Save miklb/9398b54e9fa4dd83f0c5a7adb2281e6d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
/** | |
* Featured image in atom feed. | |
* @method featuredtoRSS | |
* @param $string $content post content. | |
* @return $string $content updated content w/image. | |
*/ | |
function independence_featuredtorss( $content ) { | |
global $post; | |
if ( has_post_thumbnail( $post->ID ) ) { | |
$content = '<div>' . get_the_post_thumbnail( $post->ID, 'medium', array( | |
'style' => 'margin-bottom: 15px;', | |
) ) . '</div>' . $content; | |
} | |
return $content; | |
} | |
add_filter( 'the_excerpt_rss', 'independence_featuredtorss' ); | |
add_filter( 'the_content_feed', 'Independence_featuredtorss' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment