Home › Forums › Pro Support › Pagination issue
Tagged: pagination
- This topic has 3 replies, 2 voices, and was last updated 3 years, 1 month ago by
Tom.
-
AuthorPosts
-
August 14, 2020 at 1:14 pm #18282
Paddy
ParticipantI’ve successfully created a static page as category page – but I’m now having an issue with the pagination of the main news category. I’ve got two lists for news – one that shows four posts on the front page, with no pagination, and the second one, which shows everything else. The moment I add an offset to the second list so that it doesn’t show the first four posts which I already have on the front page, it breaks the pagination – I get page one over and over again. I’d really rather not show those first 4 posts again…but obviously, pagination needs to work. I tried the Ajax pagination too – same thing (except the repeats are on the same page). I tried resaving permalinks as that was mentioned in another post where someone had two WP Show Posts on the same page, but that didn’t fix it.
Update: I also created a static page as category page for the Large Scale Developments category – and it was working fine until I added an offset to it. I was planning on creating an intro page for that section with 4 posts on it – then continue with the rest in the category-as-static page.
So it would appear that there is a problem with offsets and pagination. Unless the category-as-static-page thing is throwing a wrench in the works.
August 16, 2020 at 9:52 am #18319Tom
KeymasterHi there,
The offset option in WordPress does have some issues with pagination, unfortunately.
Are these two lists on separate pages? If so, I would personally suggest just showing the 4 latest posts along with the rest of them. That’s a pretty standard layout, and it will save you a lot of headaches when it comes to battling WordPress with offsets and pagination.
August 16, 2020 at 12:06 pm #18332Paddy
ParticipantYes – the lists were/are on separate pages. We have come to the conclusion that we were making things more difficult/complicated for ourselves doing it this way. 😉 So the repeat on the news category will stay (as you’re suggesting) and the rest of the category pages will have their static content removed so we can use pagination and just have the one page per category.
Since you mention that this is a WP issue, I looked and I did just now find this article from WP on the issue: https://codex.wordpress.org/Making_Custom_Queries_using_Offset_and_Pagination – but I think I’ll skip trying to force the square peg into the round hole for now and get on with getting the site done.
August 17, 2020 at 2:03 pm #18370Tom
KeymasterYea, it’s possible to overcome, but it’s a pain. That article you found does have the solution if you ever want to give it a shot 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.