Replace Excerpt Ellipsis with Permalink

Avatar of Chris Coyier
Chris Coyier on

This is useful if you would like to replace the ellipsis […] from the excerpt with a permalink to the post.

functions.php addition:

function replace_excerpt($content) {
       return str_replace('[...]',
               '<div class="more-link"><a href="'. get_permalink() .'">Continue Reading</a></div>',
               $content
       );
}
add_filter('the_excerpt', 'replace_excerpt');