WordPress Snippets

Code Snippet

The backend of a WordPress site has pages, post, etc. But unlike posts, on the pages, there is no area for writing a short description (excerpt). The following code adds that functionality.

PHP

Place the following code anywhere in your child theme’s functions.php document.

// add excerpt area to backend of pages
add_post_type_support('page', 'excerpt');

Note

All modifications to a theme or plugin should be made by creating a child theme and placing the changes there. Changes made to the parent theme will be overwritten the next time it updates.

Output

Once in place, open one of your pages in the backend. You may need to go up to the top of the screen to “Screen Options” and make sure that the “Excerpt” box is checked for it to show on the page.

Then you should see this, probably towards the bottom of the page.

Adding an Excerpt Widget to the Page Backend

WordPress Notes:

  • All modifications to a theme or plugin should be made by creating a child theme and placing the changes there; changes made to the parent theme will be overwritten the next time it updates

We’d like to acknowledge that we learned a great deal of our coding from W3Schools and TutorialsPoint, borrowing heavily from their teaching process and excellent code examples. We highly recommend both sites to deepen your experience, and further your coding journey. We’re just hitting the basics here at 1SMARTchicken.