Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
xtech Posted October 8, 2016 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.
BomAle Posted October 9, 2016 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.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.