Created
February 8, 2020 20:32
-
-
Save ABooooo/f5a18058ab9b30e63ff4e8b373638d99 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
// add featured image to rss feed | |
add_filter( 'the_content', 'ld_featured_image_in_feed' ); | |
function ld_featured_image_in_feed( $content ) { | |
global $post; | |
if( is_feed() ) { | |
if ( has_post_thumbnail( $post->ID ) ){ | |
$feat_image_output = get_the_post_thumbnail( $post->ID, 'full', array( 'style' => 'height: auto;margin-bottom:2em;max-width: 600px !important;padding-top: 0.75em;width: 100% !important;' ) ); | |
$content = $feat_image_output . $content; | |
} | |
} | |
return $content; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment