Disable the Auto-Scroll/Internal Anchors in Read More Links

If you don’t like that the ‘read more’ links automatically scroll you down the page (to the beginning of what ever comes after the <–more--> tag), you can so a little pattern matching to remove the internal anchor.

add_filter( 'the_content_more_link', 'read_more_no_jump', 10, 2 );
function read_more_no_jump( $link, $text ) {
	$no_more = preg_replace( '/#more-([0-9]*)/', '', $link );
	return $no_more;
}

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: