• Resolved kvv213

    (@kvv213)


    Hello Everyone,

    It was working perfectly with 5.x versions of WordPress. When I press “Read more” it moves me to the dedicated article page and scrolls to the next place after <–more–> link.

    Now, with 6.x version it doesn’t work anymore. The button “Read more” doesn’t have any anchor.

    What is wrong and how to return the anchor behaviour back?

    Example site https://blog.kvv213.com

Viewing 2 replies - 1 through 2 (of 2 total)
  • In WordPress default there is no anchor at the more link. In your case, your theme has to set it. Since it is a custom theme, my recommendation would be that you look at its source code in this regard. It seems to be from 2012, which is why some things might have changed in the course of time – also regarding the setting of an anchor at the more link.

    Thread Starter kvv213

    (@kvv213)

    Thank you!

    The problem was fixed by adding some additional code to my filter that adds exactly the anchor:

    add_filter( 'the_content_more_link', 'modify_read_more_link',10,2 );
    function modify_read_more_link($more_link_element, $more_link_text) {
         $more_link_text="Читать далее ...";
         return '<p style="text-align: center"><a class="more-link" href="' . get_permalink() . '#more-' . get_the_ID() . '">' . $more_link_text . '</a></p>';
    }

    The original problem was probably in the priority (10) of the filter. It looks like that something changed in the priorities with upgrading to the 6th version.

    • This reply was modified 2 years, 5 months ago by kvv213.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Page scroll ing the more link doesn’t work’ is closed to new replies.