WP Excerpts

The question of how to use ‘excerpts’ in WP Posts has come up a couple of times. On finchurstdental.com for example, there are (or will be) a series of Posts with accompanying videos, and it would certainly be non-optimal to provide a blog index loading multiple embedded videos.

So I considered using the ‘Excerpt’ field in the Post editor which, one might assume, would result in the excerpt alone being displayed in the blog index, followed by some version of a ‘read more’ link. However there’s a little more to do in order to achieve such a result:

1. First, identify which template in your particular theme holds the loop of post summaries, i.e., the blog index file. In ‘blankslate’, it’s entry.ph’.

2. Then, comment out:
<?php get_template_part( 'entry', ( is_archive() || is_search() ? 'summary' : 'content' ) ); ?>
… and replace it with:
<?php the_excerpt(); ?>
… and
<a href="<?php echo get_permalink(); ?>"> Read the Post...</a>

… or whatever text you prefer for the link to the Post. With these changes, the ‘more’ tag used in the Post editor will be ignored, and the Post’s main text is not shown in the blog index; only what’s set in the Post editor’s ‘Excerpt’ field will be displayed on the blog index.

This of course requires the Post author to create a bespoke excerpt for each Post, in a different field than the main body of the Post. It’s a small effort but for some lay users of WP, this process could provide somewhat greater opportunity for error, and so IMO simply using the ‘more’ tag seems to be more user-friendly. Also, the default ‘more’ tag – <!--more--> – can be customized, e.g.:

<!--more read the rest of this truly fascinating post ... -->

sr, over & out