I’ve read through a few threads on here re pagination.
Currently i have about 24 posts. They are in date order, and when i change the settings to be 30 posts per page they are in perfect date order. (one long page)
As soon as i reduce that to say 8 per page, and pagination kicks in, the date ordering is off.
I’ve tried to play around with the pagination in /pagination.html and /list.html and no luck so far.
If anyone has any ideas, would be much appreiciated
Include a link to the source code repository of your project, because we really need the context of seeing your templates and partials to be able to help you. It is trivial to do a quick git clone on your repo, then run hugo server in your project, to help you out. On the other hand, recreating your code from screenshots, or sort of guessing at it, is not.
If you can’t share your repository for whatever reason, consider creating a dummy repo that you can share, which reproduces the problem you’re experiencing.
Sorry, i should have been more specific with that.
If you load page now you’ll see one long page of posts, all sorted in date order. This is working as expected.
To recreate the problem, go to file ‘index.html’ on line 6. you can change the number 30 to 8.
Once you’ve changed this and look at the page you’ll see it splits onto 3 or 4 pages.
However, the date ordering then does not work. the posts are no longer in date order and are completely jumbled. I have no idea why this happens.
I have tried:
changing the sorting method from date to ‘rating’ and giving each post a rating. This worked on one page but like the date sorting the logic didn’t carry into the pagination.
I believe this is being controlled in ‘pagination.html’.