WPChina
Member
Posted 2 years ago #
How can I use code for a filter in functions.php to limit the characters/text size in my RSS feeds?
I am trying to use the following code to show 10 words but it is not working:
function myFilterShortenRSS($query) {
if ($query->the_content_rss) {
$query->set('','','10');
}
return $query;
}
add_filter('pre_get_posts','myFilterShortenRSS');
WPChina
Member
Posted 2 years ago #
Sorry, anybody know the code to correctly make only the first 10 words show in the RSS feed? Or some way to only show the text before the "more" cut-off?
WPChina
Member
Posted 2 years ago #
Any ideas how to cut the RSS feed down in size?
I am fairly certain about 2 years ago the RSS feed did stop at the < !-- more -- > tag.... but now the summary continues for many more words... I would like to be able to truncate this to whatever I need to shorten it to.
StrangeAttractor
Member
Posted 2 years ago #
Have you looked at this?
http://codex.wordpress.org/Function_Reference/the_content_rss
Looks like there's some built-in options to do what you want...
Just looking into these issues myself, so probably can't offer further help, but thought you might find useful
i would also like to know how to limit the default wordpress rss to xx words (and still keep the post image)