Lego2012
12/13/2016 - 11:19 AM

Replace Excerpt Ellipsis with Permalink

Replace Excerpt Ellipsis with Permalink

<!-- 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');