-
-
Save joshfitzgerald/5946226 to your computer and use it in GitHub Desktop.
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
<?php | |
//change the default (55 words) length of excerpts to 20 words | |
function new_ex_length($length) { | |
return 20; | |
} | |
add_filter('excerpt_length', 'new_ex_length', 999); | |
//changes the [...] to a button when excerpt content is truncated | |
function new_excerpt_more($more) { | |
$readmore = 'Read More'; | |
return ' <a class="readmore" href="'. get_permalink($post->ID) . '">' . $readmore. '</a>'; | |
} | |
add_filter('excerpt_more', 'new_excerpt_more'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment