WordPress – Read More link jumps to top of post page

By default, the <!–more–> tag will send readers to the location of the tag on the post. Alternatively, you can have the more link send readers to the top of the post page instead. Simply, add this code to your functions.php file:

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');

One thought on “WordPress – Read More link jumps to top of post page

  1. Pingback: WordPress – Read More link jumps to top of post page

Leave a Reply

Your email address will not be published. Required fields are marked *

*