Forums Forums Search & Filter Pro Pagination trouble

Tagged: 

Viewing 10 posts - 1 through 10 (of 24 total)
  • Trevor
    #44099

    Hi, the chances are that your theme is using non-standard pagination code (that is, not the WordPress normal method). I would need to see the template (PHP) file for the results page to be able to know for sure.

    Anonymous
    #44135

    Hi 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
    	}
    }
    
    Anonymous
    #44137

    Oops I meant that I updated WP to 4.4.2, not 4.2.2 – couldn’t edit my post….

    Trevor
    #44142

    OK, 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
    #44144

    Thanks 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!

    Trevor
    #44147
    This reply has been marked as private.
    Anonymous
    #44151
    This reply has been marked as private.
    Trevor
    #44153

    You have mail. Check spam etc if it doesn’t appear.

    Trevor
    #44195
    This reply has been marked as private.
    Trevor
    #44231

    That type of result weirdness is sometimes caused by the S&F cache not having been rebuilt, or being in the process of re-building. Did you check in the search form setup to see what the cache was doing?

Viewing 10 posts - 1 through 10 (of 24 total)