Numbered pagination not working when filtered.

Forums › Forums › Search & Filter Pro › Numbered pagination not working when filtered.

Viewing 10 posts – 1 through 10 (of 17 total)
  • Anonymous
    #51126

    Hello Design and Code,

    I want to use paginate_links as navigation. It seems to work fine. But when I apply a filter it does not work anymore.

    The code I’m using:

    
    global $wp_query;
    
    $big = 999999999; // need an unlikely integer
    
    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
    ) );
    
    Trevor
    #51149

    Can we have a URL to see this in action?

    Also, you could change our code:

    'format' => '?paged=%#%',

    to this:

    'format' => '?sf_paged=%#%',

    Do you have the dev version from me also?

    Anonymous
    #51150

    Hey Trevor,

    I changed the format.

    I do have a URL: http://wederopbouwvansalland.nl/boerderijen/lijst/

    Gemeente is a filter.

    Filters work fine on: http://wederopbouwvansalland.nl/boerderijen/lijst/
    But not on: http://wederopbouwvansalland.nl/boerderijen/lijst/?_sft_gemeente=bathmen

    Full code:

    <div id="filters-placeholder">
    				<div id="filters-container">
    					<div id="filters">
    
    						<h6>Filters</h6>
    						
    						<?php echo do_shortcode( '[searchandfilter id="116"]' ); ?>
    
    					</div>
    				</div>
    			</div>
    			
    			<div id="page-content">
    
    				<div class="boerderij-list">
    
    				<?php
    
    					// Using parameters of S&F Pro plugin
    					$args = array( 'search_filter_id' => 116 );
    
    					query_posts( $args );
    
    					while ( have_posts() ) : the_post(); 
    
    						get_template_part( 'partials/post-boerderij' );
    
    					endwhile; 
    
    					$num = $wp_query->found_posts;
    
    					if ($num == 1) {
    						echo '<span id="num-hidden">' . $num . ' boerderij</span>';
    					} else {
    						echo '<span id="num-hidden">' . $num . ' boerderijen</span>';
    					}
    				?>
    
    				<!-- <div class="pagination">
    					<?php next_posts_link( "Volgende" ); ?>
    					<?php previous_posts_link( "Vorige" ); ?>
    				</div> -->
    
    				<?php
    global $wp_query;
    
    $big = 999999999; // need an unlikely integer
    
    echo paginate_links( array(
    	'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
    	'format' => '?sf_paged=%#%',
    	'current' => max( 1, get_query_var('paged') ),
    	'total' => $wp_query->max_num_pages
    ) );
    ?>
    
    				</div><!-- .boerderij-lijst -->

    Kris

    Trevor
    #51154

    What do you mean by ‘it does not work anymore’? What does not work, on the filtered page, what do I need to do to see it not work?

    Anonymous
    #51156

    If you go to: http://wederopbouwvansalland.nl/boerderijen/lijst/?_sft_gemeente=bathmen

    The pagination doesnt work. The page reloads the same posts.

    Kris

    Trevor
    #51264

    Ah, OK. I have passed this to the developer to look at, but he is away for a long weekend.

    Trevor
    #51266

    Whoops, posted wrong stuff here 🙁

    Trevor
    #51271

    What I meant to post was this:

    This file:

    http://wederopbouwvansalland.nl/wp-content/plugins/search-filter-pro/README.txt

    Is an out of date file. That suggests that you have an out of date version of Search & Filter Pro?

    Anonymous
    #51278

    I dont know, WordPress says it is up to date: Version: 2.1.2. I got my license key activated.

    Trevor
    #51283
    This reply has been marked as private.
Viewing 10 posts – 1 through 10 (of 17 total)
Search & Filter Support
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

We also use cookies to store items in your cart as well as allowing your to login on the site.

You can adjust all of your cookie settings by navigating the tabs on the left hand side.

By continuing to use this site, you also agree to our Privacy Policy.