[Support request] Read more on custom excerpt shows different text

Home Forums Support [Support request] Read more on custom excerpt shows different text

Home Forums Support Read more on custom excerpt shows different text

  • This topic has 3 replies, 3 voices, and was last updated 4 years ago by Tom.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1239690
    aidatün

    Hi, I used this code: https://docs.generatepress.com/article/activating-read-custom-excerpt/

    But it shows a different “read more” text than the one I’ve configured in the customizer. How can i fix that?

    Also, the code is not the same than default read more label, as I added some CCSS that is not working in custom excerpt links.

    And a tag does not have title attribute, how to place it?

    #1239880
    David
    Staff
    Customer Support

    Hi there,

    you can simply add your Read more text to either of those codes. Simply replace the Read more text with whatever you need.

    #1239886
    aidatün

    Also, how about the CSS and title atributte?

    #1240911
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    What CSS did you add?

    Try this for the title attribute:

    add_filter( 'wp_trim_excerpt', function( $excerpt ) {
        $output = $excerpt;
    
        if ( has_excerpt() ) {
            $output = sprintf( '%1$s <p class="read-more-button-container"><a class="button" href="%2$s" title="%4$s">%3$s</a></p>',
                $excerpt,
                get_permalink(),
                __( 'Read more', 'generatepress' ),
                the_title_attribute( 'echo=0' )
            );
        }
    	
        return $output;
    } );
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.