Disable Auto Go To (Jump) To Read More Tag

»»»Disable Auto Go To (Jump) To Read More Tag
In WordPress, it’s possible to a WordPress blog site to display post excerpts on the front or home page, and the visitors have to click on the title or a link to continue reading your post or article.

One way of achieving this technique is by using the quicktag called “more”. The quicktag “more” is inserted into the post at the desired break-off (or cut-off) point so that everything above it become an excerpted content of the post and everything below it will only be readable when the visitors click on the title or a link to view the whole post.

The quicktag “more” is implemented by inserting the following line of code into the post:

However, by default, when a visitor click on the Read More link, the web page loads and then automatically forwards or jumps to the spot where the <!–more–> tag is set in the post. If you do not want this kind of positioning, you can change the default function of how this works by editing the following line in wp-includes/template-functions-post.php:

$output .= ‘ <a href="’. get_permalink() . "#more-$id">$more_link_text</a>";

to

$output .= ‘ <a href="’. get_permalink() ."">$more_link_text</a>";

or

$output .= ‘ <a href="’. get_permalink() ."”>$more_link_text</a>’;

After the change, the Read More link will load the blog post and stop at the top of page instead of position where the quicktag “more” were.

Note
When upgrading WordPress, this file will be replaced so make a note of the change so you can change it again after upgrading.

By |2016-12-09T08:43:37+00:00December 9th, 2016|Categories: Web Publishing|Tags: , |3 Comments

About the Author:

LK is a technology writer for Tech Journey with background of system and network administrator. He has be documenting his experiences in digital and technology world for over 15 years.Connect with LK through Tech Journey on Facebook, Twitter or Google+.