Forums › Forums › Search & Filter Pro › Numbered pagination not working when filtered.
Tagged: Numbered Pagination
- This topic has 16 replies, 2 voices, and was last updated 8 years, 2 months ago by Trevor.
-
Anonymous(Private) July 14, 2016 at 10:47 am #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 ) );
Anonymous(Private) July 14, 2016 at 1:50 pm #51150Hey 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=bathmenFull 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
Anonymous(Private) July 14, 2016 at 2:04 pm #51156If you go to: http://wederopbouwvansalland.nl/boerderijen/lijst/?_sft_gemeente=bathmen
The pagination doesnt work. The page reloads the same posts.
Kris
-
AuthorPosts