Skip to content

Instantly share code, notes, and snippets.

@kimcoleman
Created August 15, 2018 16:54
Show Gist options
  • Save kimcoleman/6edacea2865cee9ab0050987825e6e80 to your computer and use it in GitHub Desktop.
Save kimcoleman/6edacea2865cee9ab0050987825e6e80 to your computer and use it in GitHub Desktop.
Add a (more...) link when you specify a manual except to a post using the "Excerpt" post meta box.
<?php
/**
* Add an excerpt more string to manually created excerpts.
*/
function my_memberlite_manual_excerpt_more( $excerpt ) {
$excerpt_more = '';
if ( has_excerpt() ) {
$excerpt_more = ' <a href="' . get_permalink( ) . '" rel="nofollow">(more...)</a></a>';
}
return $excerpt . $excerpt_more;
}
add_filter( 'get_the_excerpt', 'my_memberlite_manual_excerpt_more' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment