Auto Excerpt Amendments

By default the wp_trim_excerpt function (which is described as ‘Fakes an excerpt if needed’) just grabs the first 55 characters of a post and adds […] to the end to create an excerpt.

To make this longer, open up functions-formatting.php under the wp-includes folder and jump to line 645 (there or there abouts), it should say:

function wp_trim_excerpt( $text ) { // Fakes an excerpt if needed

Now find the line that says:

$excerpt_length = 55;

Change the 55 to whatever number you like, this is the number of characters the excerpt will display assuming the post is that long (somewhere between 100 and 200 works well in my experience).

If you want to remove the horrible-looking […] it adds on the end, find the line that says:

$excerpt .= ($use_dotdotdot) ? ‘[…]’ : ”;

and delete the […] between the apostrophes (but make sure to leave them there), or you can add whatever you like (a » for example).

If you use the tag in your posts, you can make it use the part up to the tag as the excerpt by replacing this line:

$excerpt_length = 55;

with the following code:

$excerpt_length = strpos(‘‘,$text);
if ($excerpt_length <= 0) { $excerpt_length = 100; }Change the 100 to the number of characters you want to display in the absence of a more tag.