• Resolved e-sushi

    (@e-sushi)


    Hey people!

    To keep it short: I’m using this in the “functions.php” of my theme to limit the “regular excerpt” for my category pages:

    function my_excerpt_length($length) {
    	return 32;
    }
    add_filter('excerpt_length', 'my_excerpt_length');

    Is there any similar functionality to limit the excerpt for RSS feeds? Since the “excerpt_length” filter does not seem to catch on in feeds at all.

    Tnx for all feedback you can provide…

Viewing 1 replies (of 1 total)
  • Thread Starter e-sushi

    (@e-sushi)

    Quick an simple answer, sharing my solution with those looking for the same thing:

    function my_feed_modder($content) {
        $content = explode(' ',$content);
    
        $content = array_slice($content, 0, 4);
        // where 4 is the number of words to show
    
        $content = implode(' ',$content);
      return $content;
    }
    add_filter('the_excerpt_rss', 'my_feed_modder');
Viewing 1 replies (of 1 total)
  • The topic ‘How to limit the excerpt for RSS feeds?’ is closed to new replies.