[Resolved] 'Read More' even if excerpt fully displayed

Home Forums Support [Resolved] 'Read More' even if excerpt fully displayed

Home Forums Support 'Read More' even if excerpt fully displayed

  • This topic has 3 replies, 2 voices, and was last updated 7 years ago by Tom.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #378387
    Eric

    Hi Tom and all,
    I would like the “Read More” link to be displayed even if excerpt fully displayed in the “Blog Content”.
    How could I do that?
    Any help will be quite appreciated
    Thank you
    Eric

    #378598
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    First, make sure your Read more label option is empty in your Blog options.

    Then try this PHP:

    add_action( 'generate_after_entry_content', 'tu_constant_read_more' );
    function tu_constant_read_more() {
        if ( ! is_singular() ) {
            printf( ' ... <a title="%1$s" class="read-more" href="%2$s">%3$s</a>',
    		the_title_attribute( 'echo=0' ),
    		esc_url( get_permalink( get_the_ID() ) ),
    		__( 'Read more', 'generatepress' )
    	);
        }
    }
    #380327
    Eric

    _/\_ Thank you so much Tom!

    #380464
    Tom
    Lead Developer
    Lead Developer

    You’re welcome 🙂

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