Forums › Forums › Search & Filter Pro › Pagination Problems
Tagged: pagination
- This topic has 22 replies, 2 voices, and was last updated 8 years, 7 months ago by Ross.
-
Anonymous(Private) March 4, 2016 at 8:15 pm #38724
I think I am having a similar issue as this ticket: https://support.searchandfilter.com/forums/topic/pagination-alwaus-return-to-page-1/. My pagination is working correctly from this page: http://67.227.198.26/~necleanenergy/residential/photos/. However as soon as I’ve filtered the results the pagination never changes from page 1.
I have the following checked:Load results using Ajax? , Make searches bookmarkable?, Only use Ajax on the results page?. Results Container is .photo-grid, which includes the results and the pagination section. The Pagination selector is .page-numbers a.
This is nav code in my functions file:
function bones_page_navi() {
global $wp_query;
$bignum = 999999999;
if ( $wp_query->max_num_pages <= 1 )
return;
echo ‘<nav class=”pagination”>’;
echo paginate_links( array(
‘base’ => str_replace( $bignum, ‘%#%’, esc_url( get_pagenum_link($bignum) ) ),
‘format’ => ”,
‘current’ => max( 1, $wp_query->query_vars[‘paged’] ),
‘total’ => $wp_query->max_num_pages,
‘prev_text’ => ‘<‘,
‘next_text’ => ‘>’,
‘type’ => ‘list’,
‘end_size’ => 3,
‘mid_size’ => 3
) );
echo ‘</nav>’;Can you help me to correct this?
Ross Moderator(Private) March 7, 2016 at 10:05 pm #38913Hey DeAnne
First, just for testing, can you disable ajax?
Then check pagination again, does it work?
If not, there can sometimes be an issue with pagination.
There are several WP functions for getting pagination, so if one is not working, its worth trying another – in case there is a conflict with something in your setup.
Can you tell me, under the “display results” tab, what “display method” are you using?
Can you test out the other WP pagination functions?
the_posts_pagination
next_posts_link
|previous_posts_link
Thanks
Anonymous(Private) March 8, 2016 at 4:36 pm #38979I have tried with ajax disabled and have the same results.
Under the “display results” tab, I have “Post Type Archive” selected under “Display Results Method”.
I tried just adding the next_posts_link | previous_posts_link code to the archive template and it seems like it updates the URL to include _paged=2, even after filtering the results, how ever I can see some of the results on page 2 are repeated from page 1. So it seems like the results aren’t actually being paginated.
Anonymous(Private) March 8, 2016 at 4:51 pm #38980I believe the reason that some of the results where repeating was because we had Default Sort Order set to Random. I assume then this affects the pagination? Can you confirm?
Can you also help trouble shoot why the pagination would work with a non filtered page: http://67.227.198.26/~necleanenergy/residential/photos/ vs not work with a filtered page http://67.227.198.26/~necleanenergy/residential/photos/?_sft_panel_location=ground&_sfm_monthly_production=0%205000, although they are using the same archive template.
Ross Moderator(Private) March 21, 2016 at 12:21 pm #39993Hey DeAnne
I’ve literally just pulled up this ticket 30 mins ago – apologies it seemed to have slipped through.
Can you provide admin details and I’ll take a good look?
I think you need to update the pagination in your template to use –
the_posts_pagination
– which I’ll be able to help with.Thanks
-
AuthorPosts