Forums › Forums › Search & Filter Pro › Pagination not working
Tagged: pagination
- This topic has 20 replies, 2 voices, and was last updated 8 years, 2 months ago by Trevor.
-
Trevor(Private) July 30, 2016 at 9:11 am #52760
I can see an error in the way that the lol-scripts.js is written (the Chrome console reports it as an error), but that is not the cause I think.
IF you are using the ‘As an archive’ results display method, is the results container set to
#main
and if so, what happens if you set it to#resource-results
?Trevor(Private) July 30, 2016 at 4:51 pm #52779Nice answer 🙂
AKAIK, it should only be used if recommended to do so by Ross. It isn’t covered in the documentation and it is entirely possible that we would change what it does from one version to another.
Genesis should work with the normal methods (like As an Archive).
Anonymous(Private) August 8, 2016 at 10:25 pm #53903It is fixable. I fixed it. For future readers of this thread, this is how I fixed it:
The issue seems to have been that I didn’t have the correct query name in there. So, in my original code I had:
<div class="pagination"> <div class="nav-previous"><?php next_posts_link( 'Older posts', $query->max_num_pages ); ?></div> <div class="nav-next"><?php previous_posts_link( 'Newer posts' ); ?></div>
Where $query did not represent any active query because it had been renamed as a custom query.
The correct code is:
<div class="resources-pagination"> <?php previous_posts_link( '<< Previous Page' ); ?> <?php next_posts_link( 'Next Page >>', $resources_loop->max_num_pages ); ?> </div>
Where $resources_loop represents the name of the custom query I had in place. (I also removed a couple of unneeded divs and renamed my wrap class.)
This gives me a functioning Previous and Next pagination.
What I really want now is to add a better experience for the users with page numbers. I was using paginate_links() with some args and it worked but it was buggy.
Suggestions?
Trevor(Private) August 9, 2016 at 8:30 am #53925Did you look at wp-pagenavi? I have not tried it myself.
Is this thread OK to close?
-
AuthorPosts