';
// Highlight the title
echo '
' . $item->title . '
';
// Split the content into sentences
$sentences = preg_split('/(?<=[.?!])\s+(?=[a-z])/i', $item->description);
// Add all the sentences of the content
$preview = implode(' ', $sentences);
echo $preview;
// If there are more than 5 sentences, add a "Read More" link
if (count($sentences) > 5) {
echo '
Read more';
}
// Close the box around the article
echo '
';
}
?>