June 16, 2014

How To Replace the Ellipsis [...] With Words 'Read More...'

|
By default or it means originally, if you create a short excerpt to the blog post of the main page or homepage, you will see three dots inside a bracket [...]. This symbol is called ellipsis.

If you don't want to have the ellipsis, you can change it to words like 'Read More...' or 'Keep Reading'. It's up to your preference.

How To Change Or Replace Ellipsis To Words

1. Go to function.php

2. Add this set of code to it.

// Replaces the excerpt "more" text by a link

add_filter('excerpt_more', 'new_excerpt_more');

function new_excerpt_more($more) {
       global $post;
    return '<a class="moretag" href="'. get_permalink($post->ID) . '"> Read More...</a>';
}


3. The code above is using the words: Read More...

4. If you like to use other wording, you just replace Read More... to any wording of your choice.

5. Click Update File button.

* Read where to add code to php file.

*How To Customize The Number Of Words In Excerpt.