xtech Posted October 8, 2016 Share Posted October 8, 2016 Hi, i have a pages database, and i would like RSS feeds to only export a bit of the content. Yet they are exporting the whole content, which makes it easier to loose visitors. Does anyone knows how to limit/truncate the RSS output? Thank you in advance. Link to comment Share on other sites More sharing options...
BomAle Posted October 9, 2016 Share Posted October 9, 2016 Don't know if you could edit the generated output of feed rss but you could use this code if possible. $text = $record->truncated(); $cc = mb_strlen($text); $max_char = 500; $truncated = mb_substr($text,0,($cc <= $max_char ? $max_char : mb_strrpos($text, " ", -($cc - $max_char)))); if the content don't have space inside $truncated will empty. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.