How to add Read More link without plugin in wordpress post

By | January 24, 2018

Some time some wordpress plugins doesn’t work, it may be your theme doesn’t support the plugin or some other reason.
You can implement ‘Read more…’ link to your post without installing any plugin. You also don’t need to insert More Tag button every time you post blog by using the following code.

Create your custom function as given below for example your function name is my_more_link()

function my_more_link ($more) {
   global $post;
   return "<a href='. get_permalink($post->ID) . '>
   Continue reading the story</a>";
}
add_filter('excerpt_more', 'my_more_link');

Paste the above code in function.php.
Instead of ‘Continue reading the story’ text you can write your own text like ‘More….’ .
You can change style of the text by creating new css class in custom.css file. You can also use image in place of ‘Read more…’

function my_more_link ($more) {
   global $post;
   return "<a href='. get_permalink($post->ID) . '>
   <img src=/images/my_link.jpg></a>";
}
add_filter('excerpt_more', 'my_more_link');