Excerpt – First Sentence & Read More

Question

I am using this function to limit the excerpt to the first sentence…

function hello_first_sentence( $string ) {
 
    $sentence = preg_split( '/(.|!|?)s/', $string, 2, PREG_SPLIT_DELIM_CAPTURE );
    return $sentence['0'] . $sentence['1'];
 
} add_filter( 'get_the_excerpt', 'hello_first_sentence', 10, 1 ); 

However, for some reason, I am unable to add the “read more” after the excerpt… any help?

0
, PauloP 1 year 2020-07-25T13:10:44-05:00 0 Answers 52 views 0

Leave an answer

Browse
Browse