Forums

How to stop read more from scrolling (6 posts)

  1. hypesketch
    Member
    Posted 5 months ago #

    When READ MORE is clicked, the reader gets scrolled to the first text after the jump. It's horrible, I've tried

    function remove_more_jump_link($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', 'remove_more_jump_link');

    which is what the official solution is according to the codex.
    http://codex.wordpress.org/Customizing_the_Read_More#Link_Jumps_to_More_or_Top_of_Page

    I tried everything, but nothing is working. The site is going to be my main job, and I need everything working perfectly, can anyone help me?

  2. Josh
    Member
    Posted 5 months ago #

    Where did you add the code above?

  3. hypesketch
    Member
    Posted 5 months ago #

    what exactly do I do with it? I just tried putting that at the bottom of functions.php and it gave me an error.

  4. Josh
    Member
    Posted 5 months ago #

    Do you use a child theme? It's best to use a child theme because it doesn't get over-written when you update your theme.

    If you are not using a child theme, the code will go at the bottom of your functions.php file, just before the closing ?> sign.

  5. hypesketch
    Member
    Posted 5 months ago #

  6. hypesketch
    Member
    Posted 5 months ago #

    I've decided to use the wp2011 theme instead, as it loads posts so they don't even have to leave the page. thanks for all the help anyways josh, I really appreciate it.

Reply

You must log in to post.

About this Topic