Wordpress - How to limit characters to show at Feeds?
In wordpress开发者_StackOverflow社区, there is settings for the feed to show Summary or Full. I want to show only content summary at Feeds. But the default summary is still too long for me. And there's another way to add excerpt at each of the post. For that option, I can't use it either because I am running multiple author blog and most of the people don't know how to add excerpt and my posting form is custom form which is not allowed to add excerpt. I tried to search at google and wordpress plugins, but still haven't get any clue yet.
Is there anyway to limit characters at feed display ? Or is there any plugin out there ? Like at feedburner, I can activate summary feeds and limit the characters.
Please kindly help me out again. Thank you.
put the following in the theme's functions.php file:
add_filter('excerpt_length',create_function('$a','return 25;'));
Where 25 is the number of words you'd like to appear in the excerpt.
If you want the normal excerpt length on the regular page but the short one in the feed, use:
if(is_feed()){
add_filter('excerpt_length',create_function('$a','return 25;'));
}
I don't know whether that will work for sure with all feeds, so I'd suggest just using it without the is_feed()
check.
精彩评论