• Original reported by @theshiningbeautycomhttps://www.ads-software.com/support/topic/read-more-button-trouble

    To reproduce this issue, activate this theme, go to WP-Admin > Appearance > Customize > Blog Layout and choose “Full Content“.

    Now all posts that have the “more” quicktag will show up an extra “Continue reading %s” link.

    This is because the content.php file has a separate section in the “entry-footer” for a read more button while the the_content() function outputs its more string.

    Solution:

    Replace line 27 with the following code:

    the_content( '<button class="read-more">' . esc_html( get_theme_mod( 'gridsby_read_more', __( 'Read More', 'gridsby' ) )) . '</button>' );

    And remove lines 42 – 48. For displaying the button for excerpts, place the following code in the functions.php file:

    function gridsby_excerpt_more( $more ) {
    	return '<a href="' . get_permalink() .'"><button class="read-more">' . esc_html( get_theme_mod( 'gridsby_read_more', __( 'Read More', 'gridsby' ) )) . '</button></a>';
    }
    
    add_filter( 'excerpt_more', 'gridsby_excerpt_more' );

    I would’ve submitted a PR but your GitHub version looks outdated.

  • The topic ‘[Bug] Two "Read more" links’ is closed to new replies.