Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
add_filter( 'wp_trim_excerpt', 'tu_excerpt_metabox_more' );
function tu_excerpt_metabox_more( $excerpt ) {
$output = $excerpt;
if ( has_excerpt() ) {
$output = sprintf( '%1$s <p class="read-more-button-container"><a class="read-more button" href="%2$s">%3$s</a></p>',
$excerpt,
get_permalink(),
__( 'Read more →', 'generatepress' )
);
}
return $output;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment