HI: andrew55 i am also looking for this solution what is your site link?
zeshankhanbwp – thanks. I’ve been reviewing this reference for a few days.
But Customizr seems to somehow create its own excerpt without a “read more” link or button, at a certain number of characters.
Still not sure how to get my own “read more” link to show on blog home page.
Hi andrew55,
Add this code to your child theme’s functions.php.
function wpdocs_excerpt_more( $more ) {
return '[...More]'; /*CHANGE TO SUIT YOUR NEEDS */
}
add_filter( 'excerpt_more', 'wpdocs_excerpt_more' );
Menaka,
Thanks for the reply and the function. It does work great at changing more text.
Any ideas on how to get this to be a link that goes to the individual post, so when visitor clicks it, it opens up to the desired post?
As of now, on our blog, it’s just text with no link.
Hi,
Please remove the code that I gave earlier.
Try adding this code for a Read More button
function new_excerpt_more($more) {
global $post;
return ' <a class="moretag btn btn-primary" href="'. get_permalink($post->ID) . '">Read More »</a>';
}
add_filter( 'excerpt_more', 'new_excerpt_more' );
Or this for a Read More link.
function new_excerpt_more($more) {
global $post;
return '<a class="moretag" href="'. get_permalink($post->ID) . '"> Read More...</a>';
}
add_filter( 'excerpt_more', 'new_excerpt_more' );
That works great. Thank you very much for you time. I think many Customizr blogs will benefit from your function.
Menaka S. This function also works great for me thanks so much…