Home › Forums › Back End › multiple loop issue – previous posts page is wrong!? › Re: multiple loop issue – previous posts page is wrong!?
Yeah you gotta check if you are on a paginated page for that first query. Otherwise that first query has no idea and will just grab the most recent post. You don’t need to do that fancy stuff to know if a post is paginated though, you can just:
// do stuff
The $paged variable is equal to the # of page you are on. So if you are at /page/2, $paged will be 2. You can use that number to offset the query. Like
That offset parameter will skip the first X posts. You’ll need to adjust as needed. As in, if you show 5 posts per page, you’ll need to offset by 6 on page two, so you’ll need to do like:
All covered in Digging Into WordPress — wink wink.