Quantcast
Channel: WordPress Experts
Viewing all articles
Browse latest Browse all 33

How to Replace Excerpt Ellipsis With Post Permalink!

$
0
0

replace excerpt ellipsisEllipsis [...] is a series of dots that usually indicate an intentional omission of a word, sentence or whole section from the original text being quoted, and though necessary for syntactical construction, is not necessary for comprehension. The most common form of an ellipsis is a row of three periods or full stops (. . .) or a pre-composed triple-dot glyph ().

If you want to replace excerpt ellipsis with post permalink, here is an useful snippet to do it. Simply paste the following code into your functions.php file. Once saved, the tip will be applied to your blog.

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

Thanks to CSS Tricks for the great snippet!

The post How to Replace Excerpt Ellipsis With Post Permalink! appeared first on WordPress Experts.


Viewing all articles
Browse latest Browse all 33

Trending Articles