Archived topic
No "Read More" buttons
17 replies · Started by Edin on January 8, 2018
I wonder why I don't have any "Read More" buttons below every article in the homepage posts view?
I have activated "Display read more as button" under Layout / Blog in the customizer.
Thank you!
Hi there,
Are you using custom excerpt?
If so try this: https://generatepress.com/forums/topic/how-to-display-read-more-when-using-the-excerpt-field/#post-297608
Thank you Leo, but curiously that didn't work for me.
Any other idea?
Hmm it should work. How did you add it?
I added the code to my functions.php.
Can you try deactivating your other plugins to see if one of them is altering the excerpt?
I've added the code again to the live site and it worked.
But it added a "Read More" text link right at the end of the excerpt, not the button?
It's not a big deal, though...
To turn it into a button, use this instead:
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="button" href="%2$s">Read more</a></p>',
$excerpt,
get_permalink()
);
}
return $output;
}
Thank you Tom. That worked perfectly!
You're welcome :)
Hello
I have the same problem, I have tested everything as indicated and nothing changes.
My site is in development, not online.
I have a actived the excerpt with a text, but in my page Blog, the excerpt no appear, just my full text.
I use a theme child and I have test with the two codes in the function.php, nothing change.
Thank you for your help
WP 4.9.2
GP Premium 1.5.6
Elementor Free 1.9.3
Can you make sure excerpt is turned on? https://docs.generatepress.com/article/blog-content-layout/#archives
If yes we would need to see the live site unfortunately.
OOOH thank you Leo :p
I must learn this theme.
So I have a problem this option, she dont change the words.

Are you using Tom's code here? https://generatepress.com/forums/topic/no-read-more-buttons/#post-481230
If so you need to actually change the "Read more" in the code.
pffff... yes... ^^
Thank you :)
It's possible to use the real code for "read_more" instead of changing the text in function.php ?