WordPress tutorials: Enable page excerpts

Wpsnipp – Enable page excerpts.Placing this php code within the wordpress functions.php file in your theme will enable excerpts for pages.Recently we were building a website using WordPress’ CMS functions and leaving out the blog entirely.

This however gave us a slight problem on the home page as we wanted to show excerpts. And a website without Posts cannot have Post excerpts, so we went looking if there was something available to solve this problem.

 

function page_excerpt() {
  add_post_type_support('page', array('excerpt'));
}
add_action('init', 'page_excerpt');
Be Sociable, Share!

Leave a comment