Viewing 3 replies - 1 through 3 (of 3 total)
  • Since WP handles pagination already, whatever you are doing is not really pagination, and needs a different variable. Find any plugin that uses its own query variables and read the code.

    Thread Starter AlanP57

    (@alanp57)

    I was hoping someone wrote a little example and posted it on line. I suppose I should post a question on wordpress.stackexchange.com.

    Moderator bcworkz

    (@bcworkz)

    Sure, ask away, as long as you don’t cross post within these WP forums.

    You really just need to change all usage of your page query var in your custom pagination code to something more distinct like foo-page or whatever. Whitelist your new query var through the “query_vars” filter.

    That said, it’s usually better to alter the default query through “pre_get_posts” action rather than doing a custom query which requires custom pagination to go with it. That way, WP still handles pagination as it normally would, allowing you to avoid the entire custom pagination mess. It’s likely more efficient too, since many custom queries disregard the default query which has already been completed anyway.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to correctly implement paginaton for non blog post’ is closed to new replies.