So I've written a function to handle excerpts but just for the front page.
http://stevefleming.co.uk/
And the function is...
function excerpt_filter2($limit) {
$content = get_the_content();
$content = preg_replace("/<img[^>]+\>/i", "", $content);
$excerpt = explode(' ', $content, $limit);
if (count($excerpt)>=$limit) {
array_pop($excerpt);
$excerpt = implode(" ",$excerpt) . "... <a href='". get_permalink(the_ID()) ."'> continue reading</a>";
} else {
$excerpt = implode(" ",$excerpt);
}
$excerpt = preg_replace('`\[[^\]]*\]`','',$excerpt);
echo $excerpt;
}
The problem, as you can see on the front page, is that it keeps appending the post id to the front of the text.
I've tried to debug the code and dumped the $excerpt array just before the implode is called to check that the id wasn't somehow being placed in the array... it wasn't.
I'm at a loss as to how the post id is getting there.
Any ideas?
Steve