WordPress Code Snippet

Use the the first Paragraph as Excerpt

Many WordPress Themes show an excerpt of the articles in the article index instead of showing the whole articles. For this WordPress provides the function the_excerpt(). By default this function uses the first 55 characters of the content and adds the text “[…]” to the end.

This simple code snippet changes the behavior of the_excerpt() to use the first paragraph of an article as its excerpt. No changes need to be made to the Theme itself.

Share this page: