Mr Portman

School website critiques, articles on education and some random cod

Controlling the excerpt of a WordPress post

Tags: , ,

Date: 31st October, 2009

I think it is something missing from WordPress, but there is no simple method for limiting the amount of text displayed  for a post. I think it would be nice if there were a variable within the_content() which limited the number of characters or words returned. Instead, I’ve used a plugin called the_excerpt_reloaded to help me reduce the number of words shown in the latest posts section of the homepage. I’ve used it like so:

<?php the_excerpt_reloaded(20, ”, ‘content’, FALSE); ?>

The first variable is the number of words I want displayed, here 20. The last variable, which I’ve set to FALSE, stops a Read more… link being added, because I wanted to add my own. To find download the plugin or find out more, visit the owner’s site: Guff : the excerpt Reloaded.

August 2010

July 2010

June 2010

May 2010

April 2010

February 2010

January 2010

December 2009

November 2009

October 2009

September 2009