apply_filters( ‘the_excerpt_rss’, string $output )

Filters the post excerpt for a feed.

Parameters

$outputstring
The current post excerpt.

Source

echo apply_filters( 'the_excerpt_rss', $output );

Changelog

VersionDescription
1.2.0Introduced.

User Contributed Notes

  1. Skip to note 2 content

    Add the post featured image to the RSS feed items

    // Add the featured image as  to the feed’s item  and 
    
    add_filter( 'the_excerpt_rss', 'wpdocs_add_featured_image_to_rss_feed' );
    add_filter( 'the_content_feed', 'wpdocs_add_featured_image_to_rss_feed' );
    
    function wpdocs_add_featured_image_to_rss_feed( $content ) {
    	global $post;
    
    	if ( has_post_thumbnail( $post->ID ) ) {
    		$content .= '' . get_the_post_thumbnail( $post->ID, 'medium' ) . '' . get_the_title( $post->ID ) . '';
    	}
    
    	return $content;
    }

You must log in before being able to contribute a note or feedback.