Site logo

Archived topic

Make read more link go to permalink instead of #more

3 replies · Started by madmanweb on July 1, 2019

Viewing posts 1–4 of 4

Hi.

I'm trying to make the "read more" links from the home page go to the top of the individual posts instead of scrolling down to the part after the <!-- more --> tag.

I used the code from this page: https://codex.wordpress.org/Customizing_the_Read_More

function remove_more_link_scroll( $link ) {
	$link = preg_replace( '|#more-[0-9]+|', '', $link );
	return $link;
}
add_filter( 'the_content_more_link', 'remove_more_link_scroll' );

But this isn't working. The "read more" links (called "Read Show Notes" on my site) still scroll down to the part after the more tag. Any idea what might be going wrong?

That worked, thank you.

No problem :)

This archived topic is closed to new replies.