WordPress: Add Excerpts to Pages

In WordPress excerpts seem to be a feature exclusively for posts. But some users might want to use it for Pages as well. Even though WordPress supports Page excerpts internally as it has the same database field as the post excerpts, it provides no option to add excerpts to pages through the WordPress admin panel. In this article we will share a plugin that adds an excerpt box for your pages similar to the one for your posts.

Open your theme’s functions.php file and add the following code:

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

 

source: wpbeginner

Artikel terkait:   WordPress: Display a List of Last Updated Posts

Isi Komentar

Alamat email Anda tidak akan dipublikasikan. Ruas yang wajib ditandai *

27 + = twenty eight

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

Scroll to Top