Modify the Read More text when using the the_excerpt()

Adding this code to your functions.php file enables you to customize the read more link text.

// Replaces the excerpt “Read More” text by a link

remove_filter(‘excerpt_more’, ‘new_excerpt_more’);
function new_excerpt_more($post) {
/return ‘<a class=”read_more” href=”‘. @get_permalink($post->ID) . ‘”>’ . ‘Read More >’ . ‘</a>’;
}

add_filter( ‘excerpt_more’, ‘new_excerpt_more’ );

Leave a comment

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

Loading...