Excerpts automatically remove paragraph space

I use excerpts of posts in my front page. In my excerpt, the summary of the post seems to be clumped together with no spaces that are indicated in the post (e.g., paragraph spaces are automatically removed). I understand this is the default behavior.

Question: Is there a way to retain the paragraph in excerpts?

Read More

To show excerpt on the fron page in my Twenty Ten theme’s loop.php I changed this (around line #137:

<?php if ( is_archive() || is_search() ) : // Only display excerpts for archives and search. ?>

with this:

<?php if ( is_home() || is_front_page() || is_archive() || is_search() ) : // Only display excerpts for archives and search. ?>

thanks.

Related posts

Leave a Reply

2 comments

  1. The line that’s important isn’t likely to be the “if”, it’s this one:

    <?php the_excerpt(); ?>
    

    That’s what spits out the content. Adding nl2br (http://php.net/manual/en/function.nl2br.php) should help return the linebreaks.

    You’ll have to manually echo it out, though, so you should use “get_the_excerpt()” instead.

    This line should work:

    <?php echo nl2br(get_the_excerpt()); ?>