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?
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.
Looks like my other answer wasn’t working, so I looked into it and found this:
http://aaronrussell.co.uk/legacy/improving-wordpress-the_excerpt/
That article should give you all you need to keep the
<p>
tags in there.The line that’s important isn’t likely to be the “if”, it’s this one:
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: