Replacing The Ellipsis With The Post’s Permalink

Our featured WordPress tutorial for today may be a long-time classic trick. It comes from renowned CSS guru Chris Coyier of CSS-tricks, and it’s about replacing the ellipsis (…) from the excerpt with a permalink to the post.

Ellipsis Replacing The Ellipsis With The Post’s Permalink

It is a pretty short snippet and so it’s very easy to implement on your site. All it takes is to copy and paste the following code below in to your functions.php file.

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

You are free to replace the Continue Reading part of the code with that of your own according to your liking.

Incoming search terms for the article:

Related Posts

How To Create A Webpage With A Clean Style Portfolio Layout

How to Create a Sparkling Diamond and Gold Text Effect

Creating Colorful Effects in Photoshop

Creating a Cool Drunken Monkey Illustration