- This topic has 7 replies, 3 voices, and was last updated 2 years ago by
David.
-
AuthorPosts
-
April 8, 2020 at 8:11 am #1231400
Anonymous
I posted this same issue a couple of days ago but now cannot find the thread, either in the main forum or in the tickets opened by me under my profile. Weird.
Anyway, to repeat:
I’m using a custom excerpt on blog posts. The read more buttons on the homepage/category pages disappears when this field in Gutenberg editor is filled with a custom excerpt. Please advise how to get the buttons back?
I’m using the latest versions of WordPress and GeneratePress.
Settings -> Reading -> Summary is enabled.
I’ve already tried using the CSS provided in other threads/help articles, e.g.
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”>%3$s</p>’,
$excerpt,
get_permalink(),
__( ‘Read more’, ‘generatepress’ )
);
}return $output;
}But receive a warning that this CSS is not valid and I need to correct it before publishing in case it breaks the website.
Thanks, looking forward to hearing back from you.
April 8, 2020 at 8:44 am #1231456David
StaffCustomer SupportHi there,
sorry we didn’t get your post π
That code is PHP – this article explains how to add it:
https://docs.generatepress.com/article/adding-php/
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/April 15, 2020 at 5:44 am #1239816Anonymous
Hi David,
Thanks for your reply.
My bad, I just copy/pasted and didn’t even register that it wasn’t CSS.
Okay, I’ve installed Code Snippets as per the documentation and tried to add this PHP code, but the code editor is still warning me that it isn’t valid.
Could you please let me know the code I should use for this snippet? Desired outcome: The Read More button shows on category pages if the custom excerpt field is filled.
Thanks again.
April 15, 2020 at 8:04 am #1240236David
StaffCustomer SupportCopy the code from here:
https://docs.generatepress.com/article/activating-read-custom-excerpt/#read-more-button
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/April 15, 2020 at 12:40 pm #1240630Anonymous
Thanks very much. π
April 16, 2020 at 4:20 am #1241249David
StaffCustomer SupportYou’re welcome
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/April 22, 2020 at 9:31 am #1249530Markus
I just wanted to tell you guys that your support is exellent! This helped a lot!
April 23, 2020 at 1:29 am #1250649David
StaffCustomer SupportAwesome – glad we can be of help π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/ -
AuthorPosts
- You must be logged in to reply to this topic.