How Do I Make a More-Link Jump to the Top of the Permalinked Page?

I am constantly tweaking and improving my websites in an effort to provide the optimum user experience.

And so, in an effort to make Ask Anne Mitchell more user friendly, I wanted to set it up so that you didn’t have to read through an entire post on the home page in order to get down to the next post. Instead I wanted to offer you the first paragraph or so, with a link to the full post if you were interested in the subject. That way, if you weren’t interested, you could quickly move on to the next, without having to wade through the entire preceding post.

WordPress actually makes it very easy by providing you with a “more” button in the editing interface, and when you want to create the break, you just insert it, like this:

Unfortunately, when you click on the “more” link, it takes you to that exact spot in the full post (i.e. to the middle of the post, rather than the beginning of the full post) which is a bit disconcerting.

Here is how to fix that, so that when you click on the “more” link, you are taken to the full text of the post, starting at the top (as you just were).

In the wp-includes directory there is a file called “template-functions.php”. In that file. at around line number 990, you will see this line:

$output .= ” $more_link_text“;

You should edit that line so that it looks like this:

$output .= ” $more_link_text“;

In otherwords, you will remove the #more-$id, but leave the leading ” and the trailing ‘ intact.

Then just save the file, and voila! Links take you to the top of your post!