Nowadays, WordPress Post Excerpt is used in almost every blog to display Post summary on Archive pages and Search result page. This post will show you how to add [Read more…] in WordPress post excerpt with a link to post single page.
Add the code below to your theme’s functions.php file.
// Add "Read More" after hand-written excerpts.
function add_read_more_to_excerpt( $excerpt ) {
if ( ! is_admin() && has_excerpt() ) {
$excerpt .= ' <p><a class="read-more" href="' . esc_url( get_permalink() ) . '">Read More »</a></p>';
}
return $excerpt;
}
add_filter( 'the_excerpt', 'add_read_more_to_excerpt' );
// Replace the default [...] in automatic excerpts with a "Read More" link.
function custom_excerpt_more( $more ) {
if ( is_admin() ) {
return $more;
}
return '... <a class="read-more" href="' . esc_url( get_permalink() ) . '">Read More »</a>';
}
add_filter( 'excerpt_more', 'custom_excerpt_more' );The first filter adds the link after excerpts you write by hand. The second replaces the default […] on automatic excerpts. An earlier version of this snippet added the link twice on automatic excerpts; this one adds it once.
View or fork this snippet on GitHub Gist.
Need this done on a live site? Exivon Tech takes on projects and audits, led by me.

