I am confused about the behaviour of the_excerpt()
and get_the_excerpt()
.
My objective is to have a manual excerpt and display a continue reading.
I went through this article, and apparently the_excerpt()
is not meant for that.
So I'm trying get_the_excerpt()
instead, and I still don't get the continue reading for some reason.
Again, the idea would be to display a manual excerpt and a continue reading link.
EDIT (forgot to add): In my functions.php I have:
function custom_excerpt_length( $length ) {
return 1;
}
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );
// Add more-link text to excerpt
function new_excerpt_more( $more ) {
return '... <a class="more-link" href="'. get_permalink( get_the_ID() ) . '">' . __('Continue Reading', 'baskerville') . ' →</a>';
}
add_filter( 'excerpt_more', 'new_excerpt_more' );
I have tried in my content.php:
the_excerpt();
and
get_the_excerpt();