Reply To: Slider blank lines and to short text
June 20, 2017 at 8:51 am
#4803
Andreas Ebbert-Karroum
Participant
Yeah, I fixed it myself in the meantime, thanks for pointing me to the correct location.
My header.php now uses this to display the first paragraph, max 200 characters, truncated at a word.
$title = get_the_title( $id );
$post = get_post($id);
$content_long = apply_filters(‘the_content’, substr(strip_tags($post->post_content), 0, 400));
$content = strtok(wordwrap($content_long, 200, “…\n”), “\n”);