This is searchable archive of our old support forums, which operated from 2012 - 2016. To find out how to get support for your current theme, please visit our support page.

Using custom query on page with Post Template results in pagination not working

  • Creator
    Topic
  • #25146
    askwpgirl
    Participant

    Hi Jason,

    I’m using the Post Grid Page Template on a page.

    I’m using this query in the Post Options area:

    cat=15,49,50,53,38,2&offset=1

    This results in the pagination displaying the same posts over and over again — so basically not working. If I place the cat IDs in the cat field and delete the above query in the custom query field, then the pagination works.

    This is ringing a bell like I’ve encountered this before and can’t remember the issue — something about the custom query not working with pagination. I want to offset the template grid by 1, so that’s the only reason I’m using the Custom Query.

    Thanks!

    Angela

Viewing 3 replies - 1 through 3 (of 3 total)
  • Author
    Replies
  • #25149
    askwpgirl
    Participant

    Shall I rephrase this? Per the WordPress Codex, offset breaks pagination. D’oh.

    So nothing broken. Nothing to fix.

    😉

    #25158
    Jason Bobich
    Keymaster

    Yup, you can’t technically have offset in a paginated WordPress query. But in the framework I have a workaround for this if you’re using a post grid element in the layout builder (I can’t remember exactly what I did but I did something a long time ago that hopefully still works).

    Anyway, in the layout builder, if you add a post grid element, you’ll notice you can select for it to be paginated and still have an offset. So, if this is something you really need, you can make your page using a custom layout instead of the Post Grid page template, which should still give you a similar visual result.

    #25165
    askwpgirl
    Participant

    I think in the Layout Builder, if you use Pagination, the offset is ignored. That’s how I read it, but I will test again. Was trying in class today.

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