[Resolved] Read More buttons not showing

Home Forums Support [Resolved] Read More buttons not showing

Home Forums Support Read More buttons not showing

  • This topic has 7 replies, 3 voices, and was last updated 4 years ago by David.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #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.

    #1231456
    David
    Staff
    Customer Support

    Hi 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/

    #1239816
    Anonymous

    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.

    #1240236
    David
    Staff
    Customer Support
    #1240630
    Anonymous

    Thanks very much. πŸ™‚

    #1241249
    David
    Staff
    Customer Support

    You’re welcome

    #1249530
    Markus

    I just wanted to tell you guys that your support is exellent! This helped a lot!

    #1250649
    David
    Staff
    Customer Support

    Awesome – glad we can be of help πŸ™‚

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.