Skip to content

Instantly share code, notes, and snippets.

@leepettijohn
Created July 1, 2016 15:48
Show Gist options
  • Save leepettijohn/0524e9d2ebdaa76401c65b3613491c32 to your computer and use it in GitHub Desktop.
Save leepettijohn/0524e9d2ebdaa76401c65b3613491c32 to your computer and use it in GitHub Desktop.
Add a READ MORE link to the excerpt function
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) . '">continue reading</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