Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save joshfitzgerald/5946226 to your computer and use it in GitHub Desktop.
Save joshfitzgerald/5946226 to your computer and use it in GitHub Desktop.
<?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-&gt;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