I'm wanting to remove the suffix dots at the end of the excerpt, how can I go about doing this? Preferably via functions.php in my theme...
I'm wanting to remove the suffix dots at the end of the excerpt, how can I go about doing this? Preferably via functions.php in my theme...
You just need to add this code to functions.php file:
function trim_excerpt($text)
{
return rtrim($text,'[...]');
}
add_filter('get_the_excerpt', 'trim_excerpt');
Or if you want that [...] to became just ... You can add this:
function trim_excerpt($text)
{
return str_replace(' [...]', '...', $text);
}
add_filter('get_the_excerpt', 'trim_excerpt');
Might be you want to change the dots with a read more link to the article. Than you can add this code:
function trim_excerpt($text)
{
return str_replace(' [...]', '<a href=' . get_permalink() . '>' . ' read more...</a>', $text);
}
add_filter('get_the_excerpt', 'trim_excerpt');
Good luck with your theme!
[spam link removed]
This topic has been closed to new replies.