Forums › Forums › Search & Filter Pro › Pagination trouble
Tagged: pagination
- This topic has 24 replies, 3 voices, and was last updated 8 years, 6 months ago by Anonymous.
-
Anonymous(Private) April 26, 2016 at 10:43 pm #44042
I’m sure you’ve been asked this and I even seem to recall seeing the solution some time ago, but searching the forum only turned up a few posts regarding pagination, and many with a lot of the comments marked as private so I wasn’t able to find the solution on my own – sorry!
I have some search results that span more than one page, but clicking on any subsequent page after the first just shows the same results as the first page (even though it appears to refresh).
I have my pagination selector set correctly (although it was working perfectly at one time when I just left it at the default .pagination a) – my theme (Quark) has a UL with the class of .page-numbers and LI’s that hold the page number – so I changed it to .page-numbers li a – but it still doesn’t work. I’ve rebuilt the cache, even though it didn’t indicate a need to, but no matter what, only page 1 results will show. I noticed also that when I click on subsequent page numbers the URL does not reflect the page number as it usually does with standard WP search results.
Any help would be most appreciated – thanks!
Anonymous(Private) April 27, 2016 at 5:22 pm #44135Hi Trevor,
Many thanks for the quick response – I’m using the Quark Theme and have been for the last two years without any trouble with pagination (in fact it was working perfectly until recently) – the only thing I can think of that has changed is updating WP to 4.2.2 (from 4.3.1) and updating the S&FP plugin to 2.1.2 (from 2.1). The Theme itself has not been updated in ages.
BUT that said, here is the code from Quark’s functions.php that constructs the navigation – it pretty much uses the standard WP pagination but replaces the ‘next’ and ‘previous’ with page numbers.
Hopefully this is helpful in finding the source of the trouble 🙂
/** * Displays navigation to next/previous pages when applicable. * * @since Quark 1.0 * * @param string html ID * @return void */ if ( ! function_exists( 'quark_content_nav' ) ) { function quark_content_nav( $nav_id ) { global $wp_query; $big = 999999999; // need an unlikely integer $nav_class = 'site-navigation paging-navigation'; if ( is_single() ) { $nav_class = 'site-navigation post-navigation nav-single'; } ?> <nav role="navigation" id="<?php echo $nav_id; ?>" class="<?php echo $nav_class; ?>"> <h3 class="assistive-text"><?php esc_html_e( 'Post navigation', 'quark' ); ?></h3> <?php if ( is_single() ) { // navigation links for single posts ?> <?php previous_post_link( '<div class="nav-previous">%link</div>', '<span class="meta-nav">' . _x( '<i class="fa fa-angle-left"></i>', 'Previous post link', 'quark' ) . '</span> %title' ); ?> <?php next_post_link( '<div class="nav-next">%link</div>', '%title <span class="meta-nav">' . _x( '<i class="fa fa-angle-right"></i>', 'Next post link', 'quark' ) . '</span>' ); ?> <?php } elseif ( $wp_query->max_num_pages > 1 && ( is_home() || is_archive() || is_search() ) ) { // navigation links for home, archive, and search pages ?> <?php echo paginate_links( array( 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), 'format' => '?paged=%#%', 'current' => max( 1, get_query_var( 'paged' ) ), 'total' => $wp_query->max_num_pages, 'type' => 'list', 'prev_text' => wp_kses( __( '<i class="fa fa-angle-left"></i> Previous', 'quark' ), array( 'i' => array( 'class' => array() ) ) ), 'next_text' => wp_kses( __( 'Next <i class="fa fa-angle-right"></i>', 'quark' ), array( 'i' => array( 'class' => array() ) ) ) ) ); ?> <?php } ?> </nav><!-- #<?php echo $nav_id; ?> --> <?php } }
Trevor(Private) April 27, 2016 at 5:42 pm #44142OK, I can see that it IS what I suspected, non-standard pagination code. I will have to talk to Ross (the developer) about this, but he is way for a few days. I will try to find a solution from within my notes, but I may have to wait for him to come back 🙁
Anonymous(Private) April 27, 2016 at 5:54 pm #44144Thanks Trevor – I really appreciate your help. I noticed that in the changelog it says that (in version) 2.1.1 there was a ‘fix – an issue with pagination filters’ – I skipped that version and updated from 2.1.0 directly to 2.1.2…..I’m certain it was working fine before I updated WP and S&FP, but maybe I shouldn’t have skipped a version?
Also, not sure if this is also helpful or not, but in testing other pages on our site, the Quark pagination code works fine – it’s only with search results that it doesn’t.
I’m fairly sure that very early on with S&FP we had this trouble and resolved it easily – in fact it was such an easy fix that I didn’t bother to keep notes (my bad!), but it didn’t involve changing the Theme’s pagination….it was something else.
We use Relevanssi, but I’ve already tried reindexing, and also in S&FP rebuilding the cache.
Lastly, no worries – it can wait until Ross gets back, and if I manage to resolve it on my own I will definitely post it here!
-
AuthorPosts