Snippet: Add “Read More” for excerpt

Add following snippet to “functions.php”


add_filter('the_excerpt', 'excerpt_read_more');
function excerpt_read_more($text) {
   return str_replace('[...]', ' <a href="'.get_permalink().'" class="read-more" style="margin:14px 0 0 0">Read more...</a>', $text); 

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>