October 8, 2016 in Technical Problems
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.
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.
This topic is now archived and is closed to further replies.
Started 17 hours ago
Started 3 hours ago
Started 1 hour ago