Forums › Forums › Search & Filter Pro › Add active class for ajax pagination
Tagged: ajax, pagination
- This topic has 11 replies, 2 voices, and was last updated 5 years, 2 months ago by Trevor.
-
Anonymous(Private) October 15, 2019 at 9:17 pm #223717
My numeric pagination is not working properly with ajax search and filter. It properly changes the page, but search and filter does not add any active or current class to the link so that I can properly highlight the link. As a result, page 1 remains highlighted regardless of which page you’re on, as that one still has the active class from the initial page load.
Is there a way to change the active class when paginating through Search and Filter? Thanks!
Anonymous(Private) October 16, 2019 at 5:50 pm #223831I’m realizing the issue isn’t just the active class — it’s not changing the page at all when you try to navigate through the filtered results. There’s just a fade as if it were changing, but nothing happens. If I turn off bookmarable searching, then the pagination works again, but it’s not paginating the results, it’s just paginating the full blog (insights).
I have the search settings to show 12 results per page, but there are more than 12 results for each category, so I need to be able to paginate the results. Are you able to see what’s going wrong here?
The pagination is built using wp_paginate_links().
Anonymous(Private) October 16, 2019 at 8:10 pm #223835More information…. when I added a custom slug to the search and filter settings, as opposed to ?sfid=XXX, the pagination correctly changed to show the next set of results again.
However the problem remains that 1) it does not change the current class when changing pages and 2) it does not show the correct number of pages. It always shows 23 pages (total regardless of filtered results).
Anonymous(Private) October 17, 2019 at 11:11 pm #224047Should clarify I also tried it with just regular posts_nav_link() function for previous/next links vs number pagination, and I get a similar issue. It navigates through the filtered results and then keeps showing a “Next page” link because it thinks there are 23 pages of results, even though there are only 2 pages of actual results. It does this with the number pagination as well. It shows you all 23 numbers regardless of how many filtered results there are, and it shows you a ‘no results’ error when you navigate beyond that page.
-
AuthorPosts