Black Friday sale! Get 25% off WPSP Pro! Discount automatically applied at checkout.

[Resolved] Pagination issue

Please login to receive premium support.

Support for the free plugin can be found here.

Home Forums Pro Support Pagination issue

Tagged: 

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #18282
    Paddy
    Participant

    I’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.

    https://leasideresidents.ca

    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.

    #18319
    Tom
    Keymaster

    Hi 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.

    #18332
    Paddy
    Participant

    Yes – 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.

    #18370
    Tom
    Keymaster

    Yea, 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 🙂

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.