WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] How can I get page to load at the very top, rather then show content below 'more

[Resolved] How can I get page to load at the very top, rather then show content below 'more

  • When a visitor clicks on the continue reading (more) on my front page they are directed to the part of the page where the content of the article they have not read appears at the top.

    Eyesopenreport.com

    I would like the visitor to open the page at the very top so my header and ad’s can show right away.

    How can I make this happen?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Yup! Add this code to your custom functions:

    function my_more_jump_to_top($link) {
        $offset = strpos($link, '#more-');
        if ($offset) {
            $end = strpos($link, '"',$offset);
        }
        if ($end) {
            $link = substr_replace($link, '', $offset, $end-$offset);
        } 
    
        return $link;
    }
    add_filter('the_content_more_link', 'my_more_jump_to_top');

    Thanks Josh! That did the trick.

    My pleasure 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] How can I get page to load at the very top, rather then show content below 'more’ is closed to new replies.