Skip to content
This repository has been archived by the owner on Sep 16, 2019. It is now read-only.

Pagination #286

Closed
joewellmade opened this issue Mar 27, 2015 · 3 comments
Closed

Pagination #286

joewellmade opened this issue Mar 27, 2015 · 3 comments

Comments

@joewellmade
Copy link

Hi Ole, sorry to hassle you again, however, I can't seem to get the pagination working on normal pages where I have custom posts displayed. It is working on one page: category-highlights.php which is a category custom post page. My other page: page-events.php. Can you help at all?

http://pastebin.com/4q7dVuPf

@toddlininger
Copy link

Hi joe, I had this same problem with custom post types and I found this post which indicated that next_posts_link & previous_posts_link expect the query object to be called $wp_query. Like you I had been using a custom variable name $custom_query and I spent several hours trying to figure out why pagination wouldn't work. I've found no mention of this on the Wordpress Codex which makes it especially frustrating.

So in your case you would replace:
$the_query = new WP_Query( $args );
with $wp_query = new WP_Query( $args );

I hope this works for you as well as it did for me.

@olefredrik
Copy link
Owner

@joewellmade : have you tried @quadriclops 's suggestion? If this works for you, it would be good if you could close the issue. If not, please let us know what did not work (the errors you get) and we'll keep the ticket open. Cheers

@joewellmade
Copy link
Author

Hi guys, thanks for this, really appreciate it, I have everything working now!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants