Improve the excerpt

We really should make that excerpt a bit better, we already know how to change it’s length, but that ‘…’ could be improved to be more accessible and we could also make it link to the full article.

Add the following to functions.php. Un-comment the latter return (and comment out the former) if you want to add the link!

Code Snippet:

<?php
add_filter('the_excerpt', 'new_excerpt_hellip');
function new_excerpt_hellip($text)
{
   return str_replace('&#91;...&#93;', '&hellip;&#91;+&#93;', $text);
   //return str_replace('&#91;...&#93;', '&hellip;<a href="'. get_permalink($post->ID) . '">[+]</a>', $text);
}
?>

Posted in Pure hacks, Posts