I don’t want users to be sent to the top of the page; I want them to be sent to the top of the loop.
How can I set a specific location for the “scroll to top” feature?
I don’t want users to be sent to the top of the page; I want them to be sent to the top of the loop.
How can I set a specific location for the “scroll to top” feature?
Hi Shankar,
Sorry for the late reply.
scroll_top already scrolls to the top of the paginated loop, not the top of the page:
<Loop type=post paged=5>
...
</Loop>
<PaginateButtons scroll_top=true />
Behind the scenes, the loop is wrapped in a <div class="tangible-paginator-target">, and that’s where the page scrolls to. If you’re still ending up at the top of the page, a few things to check:
Make sure scroll_top=true is on . Without it, the page doesn’t scroll at all.
Content above the tag, like a heading, sits above the scroll point, so it will be just out of view after the scroll.
If your site has a sticky or fixed header, it will cover the top of the loop. There’s no offset setting yet, but you can add a class to the loop and use CSS to move the scroll point up by your header’s height:
<Loop type=post paged=5 class=my-paged-loop>
...
</Loop>
<PaginateButtons scroll_top=true />
.my-paged-loop {
padding-top: 100px; /* your header height */
margin-top: -100px;
}
If it’s still not landing where you expect, share your template and a link to the page and we’ll take a look.