How to Display Post Excerpts in WordPress Themes

Do you want to learn how to display post excerpts in your WordPress theme?

By displaying post excerpts instead of the full article on your blog, you can increase pageviews, reduce loading speeds, and create a better experience for your users.

In this article, we’ll show you how you can easily add post excerpts to your WordPress theme.

How to display post excerpts in WordPress themes

Why Display Post Excerpts in WordPress?

Post excerpts are commonly used on blog index and archive pages to avoid displaying the full text for every article on your WordPress site.

By default, WordPress will show full posts on your home page, blog page, and archive pages across your website. WordPress does have built-in support for displaying post excerpts, but not every theme will take advantage of this.

Using excerpts can help to speed up WordPress since only a portion of each article will be loaded.

Plus, it can increase your pageviews since your visitors will have multiple blog posts to choose from, instead of a single long post.

That being said, let’s show you how you can display post excerpts in your WordPress theme.

Check if Your WordPress Theme Supports Post Excerpts

Most popular WordPress themes will already come with built in settings to display excerpts of your posts.

You can find this in your WordPress theme settings panel, or by going to Appearance » Customize and then clicking the ‘Blog’ menu option.

Go to WordPress customizer click blog

This brings you to a screen where you can customize your WordPress blog and archive page settings.

Simply click the ‘Blog/Archive’ menu option.

Click blog and archive menu option

After that, scroll down to the bottom of the menu to the ‘Post Content’ section.

Then, click the ‘Excerpt’ button.

Turn on post excerpt option

That’s it! Don’t forget to click the ‘Publish’ button to save your changes.

This will enable post excerpts for your WordPress theme. Depending on the theme you’re using, the menu options might be slightly different.

Display Post Excerpts by Adding Code to WordPress

If your theme doesn’t have built-in support for post excerpts, then you’ll need to add it manually.

You can edit your WordPress theme files directly, but we recommend creating a child theme. That way, when you update your WordPress theme you won’t lose the changes you’ve made.

For more details, see our beginner’s guide on how to create a WordPress child theme.

Once you’ve created your child theme, you need to find the right template for the pages you want to display post excerpts. For most themes, this will be the home.php, content.php, category.php, and archive.php.

For help finding the right template file to edit, see our beginner’s guide to WordPress template hierarchy.

After that, you need to locate the following code in each of the files:

Then, you need to replace it with the_excerpt tag, like the code below:

After you save your files, your post excerpts will display where the full article used to be.

Change the Default WordPress Excerpt Length

Once you’ve added post excerpts to your WordPress theme, you might want to change the post excerpt length. By default, WordPress will take the first 55 words of the post and add an ellipsis (…) to the end.

You can change this by adding code to your WordPress files. If you haven’t done this before, then see our beginner’s guide pasting snippets from the web into WordPress.

Then, you need to add the following code to your functions.php file, in a site specific plugin, or by using a code snippets plugin.

// Changing excerpt length
function new_excerpt_length($length) {
return 100;
}
add_filter('excerpt_length', 'new_excerpt_length');

// Changing excerpt more
function new_excerpt_more($more) {
return '...';
}
add_filter('excerpt_more', 'new_excerpt_more');

This code changes the post excerpt length to 100 characters. You can change the ‘100’ to your preferred character length.

If you want even more options for customizing your post excerpts, then see our guide on how to customize WordPress excerpts with no code.

We hope this article helped you learn how to display post excerpts in WordPress themes. You may also want to see our guide on how to choose the best web design software and our expert picks of the best HR payroll software for small businesses.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.