Forums

the_excerpt() retain new lines (3 posts)

  1. shang12
    Member
    Posted 8 months ago #

    When a user searches on my wordpress site, the_excerpt is called to display the search results, however all new lines from my original post are removed. I have tried modifying the wp_trim_excerpt function, however the $text passed to this function already has all new lines removed.

    Essentially, I want the_excerpt to retain new lines from my blog post when displaying the results information.

    Does anyone know how to do this?

  2. Rev. Voodoo
    Volunteer Moderator
    Posted 8 months ago #

    http://aaronrussell.co.uk/legacy/improving-wordpress-the_excerpt/

    Here's one example, there are tonnes of examples on google for you to check out.....

  3. shang12
    Member
    Posted 8 months ago #

    Like I mentioned in my post the $text passed to this function already has the new lines removed, so modifying this function has no effect.

Reply

You must log in to post.

About this Topic