Created
May 3, 2018 16:09
-
-
Save EastSideCode/66c0ff29ba3f948c4d0eb248de44b80f to your computer and use it in GitHub Desktop.
Edit WordPress excerpts
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
// Replaces the excerpt "Read More" text by a link | |
function new_excerpt_more($more) { | |
global $post; | |
return '... <a class="read-more-link" href="'. get_permalink($post->ID) . '">Read More</a>'; | |
} | |
add_filter('excerpt_more', 'new_excerpt_more'); | |
// change excerpt length | |
function custom_excerpt_length( $length ) { | |
return 39; | |
} | |
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment