[Resolved] Make read more link go to permalink instead of #more

Home Forums Support [Resolved] Make read more link go to permalink instead of #more

Home Forums Support Make read more link go to permalink instead of #more

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #946666
    madmanweb

    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?

    #946668
    Leo
    Staff
    Customer Support

    Hi there,

    Give this a shot:
    https://docs.generatepress.com/article/generate_more_jump/

    Let me know ๐Ÿ™‚

    #946673
    madmanweb

    That worked, thank you.

    #946677
    Leo
    Staff
    Customer Support

    No problem ๐Ÿ™‚

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