Skip to content

Instantly share code, notes, and snippets.

@asufian97
Created November 3, 2017 02:13
Show Gist options
  • Save asufian97/685ad01bd0023e57b04ca902eaaee427 to your computer and use it in GitHub Desktop.
Save asufian97/685ad01bd0023e57b04ca902eaaee427 to your computer and use it in GitHub Desktop.
wordpress expert post read more
function new_excerpt_more($more) {
return '';
}
add_filter('excerpt_more', 'new_excerpt_more', 21 );
function the_excerpt_more_link( $excerpt ){
$post = get_post();
$excerpt .= '<a href="'. get_permalink($post->ID) . '">Read More </a>.';
return $excerpt;
}
add_filter( 'the_excerpt', 'the_excerpt_more_link', 21 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment