admin管理员组

文章数量:1130349

I'd like to utilize excerpt field on pages. How do I enable it?

Currently excerpt block only shows on posts in sidebar. But on pages it’s missing.

I'd like to utilize excerpt field on pages. How do I enable it?

Currently excerpt block only shows on posts in sidebar. But on pages it’s missing.

Share Improve this question asked Jan 11, 2019 at 12:25 RunnickRunnick 1,0593 gold badges14 silver badges27 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 21

It's nothing new with the block editor, it's the same age-old way by putting the following code into your theme's functions.php:

add_action( 'init', 'wpse325327_add_excerpts_to_pages' );
function wpse325327_add_excerpts_to_pages() {
    add_post_type_support( 'page', 'excerpt' );
}

Here's my screenshot in a fresh WordPress 5.0.3 install:

I'd like to utilize excerpt field on pages. How do I enable it?

Currently excerpt block only shows on posts in sidebar. But on pages it’s missing.

I'd like to utilize excerpt field on pages. How do I enable it?

Currently excerpt block only shows on posts in sidebar. But on pages it’s missing.

Share Improve this question asked Jan 11, 2019 at 12:25 RunnickRunnick 1,0593 gold badges14 silver badges27 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 21

It's nothing new with the block editor, it's the same age-old way by putting the following code into your theme's functions.php:

add_action( 'init', 'wpse325327_add_excerpts_to_pages' );
function wpse325327_add_excerpts_to_pages() {
    add_post_type_support( 'page', 'excerpt' );
}

Here's my screenshot in a fresh WordPress 5.0.3 install:

本文标签: block editorAllow excerpt for pages in Gutenberg