Skip to content

Instantly share code, notes, and snippets.

@AMNDesign
Last active December 21, 2015 21:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AMNDesign/6366541 to your computer and use it in GitHub Desktop.
Save AMNDesign/6366541 to your computer and use it in GitHub Desktop.
Add a "read more" link after both manual excerpts and regular excerpts in WordPress.
<?php
//* Add read more link after both manual excerpts and regular excerpts
add_filter('the_excerpt', 'amn_manual_excerpt_read_more_link');
function amn_manual_excerpt_read_more_link($output) {
global $post;
return substr($output,0,-5).'... <a href="' . get_permalink($post->ID) . '">Read More</a>.</p>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment