0

I want to edit some outputs such as the content or description fields.

Do I have to make a custom rss feed just to change one thing?

1

If you want to change the content shown in a feed, use the the_content_feed filter:

add_filter( 'the_content_feed', function ( $content, $feed_type ) {
    $post_id = get_the_ID();

    if ( $feed_type === 'atom' )
         $content = 'something else';
    else
         $content = wp_trim_words( $content, 30 );

    return $content;
}, 10, 2 );

The above is purely an example of some of the (bizarre) things you might want to do.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.