In the alternate thumbnails layout, the default display shows the excerpt with a […] at the end. The thumbnail and the title are linked to the post. If you want to add a “Read More” link or a “Read More” button, here is how your do it.
To replace the […] with a [Read More] link, add this to your child theme’s functions.php
function new_excerpt_more($more) { global $post; return ' <a class="moretag" href="'. get_permalink($post->ID) . '">[Read More]</a>'; //Change to suit your needs } add_filter( 'excerpt_more', 'new_excerpt_more' );
To replace the […] with a Read More button, add this to your child theme’s functions.php
function new_excerpt_more($more) { global $post; return ' <a class="moretag btn btn-primary" href="'. get_permalink($post->ID) . '">Read More »</a>'; //Change to suit your needs } add_filter( 'excerpt_more', 'new_excerpt_more' );
10 thoughts on “Replace … with “Read More” link or button”
Is there a way to get this working with Nimple Page Builder Post Grid Layoit?
Thanks for getting in touch. Please open a new thread about this in Nimble Builder’s forum : https://wordpress.org/support/plugin/nimble-builder/
This is the preferred way to report issues with Nimble Builder because it can benefit all users.
How to do it if i don’t have child theme?
Hi, please open a new thread in the Customizr forum : https://wordpress.org/support/theme/customizr
This is where our team adresses all theme’s requests and issues.
Thanks !
menaka… always helpful! thanks again… just passing by
very good and helpful article menaka.
Thanks!
Thanks Menaka. Your posts have been helpful a lot to my site. You are appreciated. is there anyways to make the button smaller
Hi Kabie,
Glad that it is helpful. Change the btn class to btn-small or btn-mini.
Hi Menaka.
I wish there were better words than “Thank You” sorted.