Skip to content

Instantly share code, notes, and snippets.

@jeremyboggs
Created October 11, 2012 15:16
Show Gist options
  • Save jeremyboggs/3873149 to your computer and use it in GitHub Desktop.
Save jeremyboggs/3873149 to your computer and use it in GitHub Desktop.
Filters 'excerpt_more' in WordPress to provide a 'Continue reading' link. Add to your theme's functions.php file.
<?php
/**
* Filters 'excerpt_more' to provide a 'Continue reading' link.
*/
function custom_excerpt_more($more) {
global $post;
$more = '&hellip;. <a href="'. get_permalink($post->ID) . '">Continue reading.</a>';
return $more;
}
add_filter('excerpt_more', 'custom_excerpt_more');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment