Show first sentence of blog post in blog roll

Is there a known way to show the very first sentence of the content of a blog post? I know I can use the_excerpt(); but client has a strange requirement to show only the first sentence. If there is a known method for this that would be great to know. I appreciate it.

1 Answer
1

Assuming you want to cut off a string after the first full stop you could use something like this:

$the-content = "This is the first sentence. And this is the second";
$cut-in-two = explode('.', $the-content, 2);
$first-sentence = $cut-in-two[0];

Leave a Comment