Loading...

If you ever find yourself needing an extra content area, saved as part of the post object, in your page template which is nice and straightforwards to access I find the best method is to add the excerpt functionality with add_post_type_support().

<?php add_post_type_support( 'page', 'excerpt'); ?>

Whilst the example above adds the ‘excerpt‘ functionality to the ‘page‘ post type, both are interchangeable, so you could define existing post types – post, page etc or a custom post type and add any of the functionality listed below (where it isn’t already in use).
title, editor, author, thumbnail, excerpt, trackbacks, custom-fields, comments, revisions, post-formats

Note: This should be added on the ‘init‘ WordPress action, so either drop it into one of your functions already being called – the one registering your post types should be firing then too or use the example below.

<?php add_action('init',function(){
  add_post_type_support( 'page', 'excerpt' );
}); ?>

Latest Posts

Portfolio

Contact

Fill in the form below to send us a message. Your details will not be used for promotional purposes or passed on to any third parties.

 

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close