Whenever a user searches on my small wordpress site, the_excerpt is known as to show the search engine results, however brand new lines from the original publish are removed. I've attempted modifying the wordpress_trim_excerpt function, nevertheless the $text passed for this function already has brand new lines removed.

Basically, I would like the_excerpt to retain new lines from the blog publish when exhibiting the outcomes information.

Does anybody understand how to do that?

what you might do is make use of the_content() rather than while usingclip, which for those accounts strips all styling in the text,

then make use of a little function such as this inside your functions.php file

<?php
function truncateText($content, $chars = 150) {
    // Change to the number of characters you want to display
    $content= $content." ";
    $content= substr($content,0,$chars);
    $content= substr($content,0,strrpos($content,' '));
    $content= $content."...";
    return $content;
} 
?>

then inside your theme, or had you been want the written text to apear simply make a phone call to that particular function

<?php
  $text = the_content();
  echo truncateText($text, 250);
?>

hopfully should point you within the right direction..

Marty