Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have a strange situation occurring with a website that I am currently developing. On the main articles page at http://wptest.lancscps.co.uk/articles/ when the user clicks on the continue reading link to view the single page based on the single-article.php, we end up halfway down the page which isnt the desired effect. I would prefer the user to be taken to the top of the page as one would expect.

Has this happened to anyone else and are there any known reasons for this?

share|improve this question
add comment

1 Answer

You are using more tag to split article into teaser and rest of content. "More" link assumes that reader already done with former and tries to navigate browser to that point in full article.

Codex has modifying this behavior documented in Customizing the Read More > Prevent Page Scroll When Clicking the More Link and suggests following code:

function remove_more_link_scroll( $link ) {
    $link = preg_replace( '|#more-[0-9]+|', '', $link );
    return $link;
}
add_filter( 'the_content_more_link', 'remove_more_link_scroll' );
share|improve this answer
    
Works a treat, much obliged to you! –  Jonathan Beech Mar 1 '13 at 18:55
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.