How to add excerpt support for WordPress pages

Adding a custom excerpt in WordPress posts is easy – when you’re editing a post, you can turn on the excerpt metabox in screen options and away you go. But that option is not available when you’re editing pages. Thankfully, the add_post_type_support function makes it very easy to add.

add_action ('init', 'emw_add_excerpt_support');

function emw_add_excerpt_support () {
	add_post_type_support('page', 'excerpt');
}

Or, if you want it in one line:

add_action ('init', create_function ('', "add_post_type_support('page', 'excerpt');"));

Comments

  1. Thanks for that, exerpts for an image slider have been driving me nuts for a couple of hours.
    This was just the ticket.

Speak Your Mind

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.