This post is a bit nostalgic as it references the first topic that I ever wrote about WordPress on a blog. A little over two years ago, I wrote a post called How to Activate Excerpts for Pages in WordPress Admin Panel which explains the work that I had done while migrating my custom theme from WordPress 2.3.3 to WordPress 2.5.
The post was updated when WordPress 2.9 came around because someone commented that the cool drag and drop feature wasn’t working with the 2.5 code. This morning, I updated the page again for WordPress 3.0 – probably for the last time ever!
The WordPress developers have been adding really cool functionality to the core for the soon-to-be-released 3.0. one of the features that I’m really excited about is custom post types. I was looking through the core this morning when I realized that some of the functions behind this feature would allow users to add excerpts to pages with a single line of code:
add_post_type_support( 'page', 'excerpt' );
Drop this line in your active theme’s functions.php file and you’re good to go… probably forever!
From 2.3 though 2.9 I have came up with 3 different methods for enabling excerpts for pages. Why? You ask. Easy answer: WordPress changed the html that displayed the excerpt’s meta box in the administration panels. The example above contains no html – It’s even small enough to post on Twitter – It will always use whatever html WordPress needs to function properly eliminating the need to update every other version.
Now that’s progress!