Add excerpts to pages in WordPress

Put this code in your functions.php file and you’re all set. You’ll now see the excerpt pane on your edit page screen just the same as on your edit post screen.
add_action( 'init', 'my_add_excerpts_to_pages' );
function my_add_excerpts_to_pages() {
add_post_type_support( 'page', 'excerpt' );
}

But what good does that do me? (you might ask)

Now you can show excerpts of your pages just like you can with your posts. You’ll just have to modify the query a bit like this:
$args=array(
'post_type'=>'page', //this is the important part
'post__in' => array(8), //you can specify a page here by using the page id. This part is not necessary if you want to show all page excerpts
'order' => 'ASC' //You can put them in order here. Again, not necessary.
);
$page_query = new WP_Query($args);
while ( $page_query -> have_posts() ) : $page_query->the_post(); ?>
/* Your code goes here */
endwhile; // End the loop. Whew.

Jeff Roberts Web Design
7700 Howe Drive
Prairie Village, KS 66208

Copyright 2018. All Rights Reserved.