| WordPress

Many WordPress themes rely on "Excerpts" to show a short summary of your WordPress content.

You'll find an "Excerpts" box on all your WordPress Posts, but you won't find them on Pages. Excerpts on WordPress pages used to be a standard feature, then they were removed in WordPress 3.1.

Fortunately, if you need to use excerpts, it is easy to put the excerpt window back for "Pages". All you need is a single line of code.


What are excerpts in WordPress?

If you're unsure what excerpts are, check out this video from the PublishPress plugin


Step #1: Locate your functions.php file

First, let's find the WordPress file that we need to edit.

  • Using an FTP Program or File Manager, go to /wp-content/themes/yourtheme/functions.php
  • If there isn't a functions.php file there, you can create a blank file and call it functions.php.
  • If you are using a child theme, create a functions.php in the child theme's directory.

The best choice is to use a child theme. This way when you upgrade your theme your changes won't be overwritten. See this tutorial on creating a child theme if you need help.

Note: There is also a functions.php file in the wp-includes folder. Don't use that one unless you are an expert PHP coder. That is a core file and only work on core files as a last resort - or never.

find functions.php file in WordPress

Step #2: Open the file for editing

  • Open the functions.php file in a script editor.
  • Scroll to the bottom .
  • Find the last line.
  • Paste the snippet and then save the file:


 add_post_type_support( 'page', 'excerpt' );
 

Here's how that code will appear inside your functions.php file:

Finding the WordPress functions file

Step #3. Create a New Page on Your WordPress site

Go to create a new Post. You'll see the excerpt box on the editing page. If it's not visible, Check the Screen Options and see if the correct checkbox is checked.

Adding excerpts to WordPress posts

If you want to do more with your WordPress excerpts, check out this excerpts guide from PublishPress.


About the author

Steve is the founder of OSTraining. Originally from the UK, he now lives in Sarasota in the USA. Steve's work straddles the line between teaching and web development.