Created
July 1, 2016 15:48
-
-
Save leepettijohn/0524e9d2ebdaa76401c65b3613491c32 to your computer and use it in GitHub Desktop.
Add a READ MORE link to the excerpt function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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