Pagination Scroll to top bug

Pagination scroll to top feature doesn’t move page to the top (start of the loop) but it moves a little down of top. Please try yourself and you will find the bug.

I don’t think this is a bug, but let me know if I’m misunderstanding what you’re describing. The scroll to top feature is designed to scroll the user’s browser so that the top of the browser window lines up with the top of the first item of the paginated loop. This means that if you have a floating navigation menu (or if you’re looking at the page while logged in and you can see the WordPress admin bar at the top), then those menus might hide part of the first item in your paginated loop. If that’s what you’re noticing, then it’s not a bug and is the intended behaviour. If that’s not what you’re noticing, then maybe you can share a screenshot (or even better, a screen recording) showing what happens when you use scroll_top=true.

1 Like

Thanks man. I checked it after logging out of WordPress and its fine now. It happens only due to WordPress topbar.

@benjamin, good answer, but for those of us who do have a floating navigation menu bar, is there any way to modify the scroll_top function to go say 80px higher than the top?

@RichardC I looked into this a bit and it seems like this scroll position is set with JS by L&L itself, which means that offsetting it would have to be done in JS as well unless there was a feature added to allow offsetting it directly within your template. I’ve made a feature request for that so we’ll see if that gets approved by the devs.

1 Like

Thanks, @benjamin. This would be useful for more cases than sticky top menus – some content looks awkward when jammed up against the top and would benefit from a bit of breathing room.

1 Like