Created
April 22, 2022 08:25
-
-
Save bradleysa/1ae9fb7af399faa7df9a1a7bd08f9faa to your computer and use it in GitHub Desktop.
Read More Link with Excerpt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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-container"><a class="ast-button" href="%2$s">Read more</a></p>', | |
$excerpt, | |
get_permalink() | |
); | |
} | |
return $output; | |
} | |
/** https://generatepress.com/forums/topic/read-more-button-disappears-when-using-manual-excerpts/#post-476456 **/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment