Want create site? Find Free WordPress Themes and plugins.

In this code snippet, I’ll show you how easy it is to add a featured image from all your posts anywhere in your RSS feed. This tip works regardless of whether you’re using Feedburner or your default WordPress RSS feed address.

The Code Snippet:

add_filter( 'the_content', 'featured_image_in_feed' );
function featured_image_in_feed( $content ) {
    global $post;
    if( is_feed() ) {
        if ( has_post_thumbnail( $post->ID ) ){
            $output = get_the_post_thumbnail( $post->ID, 'medium', array( 'style' => 'float:right; margin:0 0 10px 10px;' ) );
            $content = $output . $content;
        }
    }
    return $content;
}

Now enjoy!..

Did you find apk for android? You can find new Free Android Games and apps.
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...

Posted by Editorial Staff