Change WordPress Default Excerpt [...]

WordPress excerpt by default, looks like [...]. But this is not what we might want for a costumer's page, where their blog/site is more corporate. That's why, we will see how to change it.

Edit your theme's  functions.php file (create one if it doesn't exist) and paste the following code

<?php
function replace_excerpt($content) {
return str_replace('[...]', '<br /><a href="'. get_permalink() .'">Continue Reading &raquo;</a>', $content);
}
add_filter('the_excerpt', 'replace_excerpt');
?>

Change "Continue Reading" to whatever you prefer to be the name of the link. So simple, so easy!

Do you have a better way to do it? Do you know of a plugin that does that kind of stuff? Please, let us know!

Tags: ,

Author:

Leave a Comment