Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I’m trying to shorten the content of my RSS feed. Right now it displays way, way too much for each entry and I’ve tried to select the “Excerpt” in the Syndications setting in my option panel but it hasn’t done anything.

I’ve tried different approaches but little has it helped.

Is there a simple way (possible add_filter) where I can set the RSS feed content length to, say, 200?

Thanks
- Mestika

share|improve this question
add comment

2 Answers

up vote 0 down vote accepted

I usualy make a RSS feed in my template. Just copy the RSS feed you have in the wp-include/feed-rss2.php
Step two is registering it instead of the original:

// override feeds
function own_rss( $for_comments ) {
    //it is in my theme/feed/rss2.php
    $rss_template = get_stylesheet_directory() . '/feed/rss2.php';
    if( file_exists( $rss_template ) ) {
        load_template( $rss_template );
    } else {
        do_feed_rss2( $for_comments ); // Call default function
    }
}
remove_all_actions( 'do_feed_rss2' );
add_action( 'do_feed_rss2', 'own_rss', 10, 1 );

Step three is adjusting the your own RSS to your needs.

also look at this: http://codex.wordpress.org/Customizing_Feeds

share|improve this answer
add comment

I get it to work - it was simply because my Excerpt length wasn't correct and because I'm using my own "shoren" function and not the excerpt on my blog. Now it works fine..

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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