Wordpress Snippets

Add Excerpt Support for WordPress Pages

By default WordPress does not allow excerpt to pages and it’s probably for good reason because normally you will never use it for pages. That’s why WordPress provides no option to add excerpts to pages through the WordPress admin panel but it’s fairly very easy to enable excerpt for pages too, similarly like posts.

To enable excerpt support for pages, you should copy and paste following code snippet in your theme’s functions.php file.

// add excerpt support for pages
function wcs_add_excerpt_support_pages() {
    add_post_type_support( 'page', 'excerpt' );
}
add_action( 'init', 'wcs_add_excerpt_support_pages' );

Hire Us. Or just say Hi!
Need a job? Apply to get one.