Look at the wp_trim_excerpt function in wp-includes/formatting.php.
Thanks I was able to clear that up perfectly! And just for future reference the wp_trim_excerpt function begins on line 772 in formatting.php in v. 2.1.3
would you mind noting the code you used within the wp_trim_excerpt function to make this work? particularly what to put in the array_push()
thanks!
I had to do the same thing this past week.
Here is the code that I used in
wp-includes/functions-formatting.php
in the wp_trim_excerpt() function:
$words = explode(' ', $text, $excerpt_length + 1);
if (count($words) > $excerpt_length) {
array_pop($words);
! /* array_push($words, '[...]'); */
! $morelink = '<a>ID) . '"
[...More...]</a>';
! array_push($words, $morelink);
$text = implode(' ', $words);
}
}
Hope that helps.
You can see it working on my Low Vision Guide website at:
http://www.lowvisionguide.org.
Shawn McMurdo
Hi Shawn,
I’m having a few problems implementing your code snippet. I can get the […More…] tag out but how do I add the href attribute to the tag?
When pasting your snippet I got a couple of errors around the line with
! $morelink = '<a>ID) . '"
Looks like there’s a few extra chars slipping in there!
So far I’ve got:
$words = explode(' ', $text, $excerpt_length + 1);
if (count($words) > $excerpt_length) {
array_pop($words);
/* array_push($words, '[...]'); */
$morelink = '<a>'.'
[...More...]</a>';
array_push($words, $morelink);
$text = implode(' ', $words);
}
where do I go from here?
You could simply use this plugin to customize your excertpts… and no need for messing with the core files 🙂
http://guff.szub.net/2005/02/26/the-excerpt-reloaded/
$morelink=sprintf("<a href=\"%s\"> [read more]</a>", get_permalink());
array_push($words, $morelink);
Would do the trick.