Forums Forums Search & Filter Pro S&F URL is breaking my pagination

Viewing 6 posts - 1 through 6 (of 6 total)
  • Anonymous
    #153546

    Hello!

    I would like to use my own code for numbered pagination. For the most part, everything is working great, but my active state for the pagination doesn’t change to match the URL and I discovered it’s because the plugin is overwriting the URL. Do you know how I can make these two get along?

    <?php
    // The Query
    $paged = get_query_var('paged') ? get_query_var('paged') : 1;
    $args = array(
      'posts_per_page' => 9,
      'paged' => $paged
    );
    $args['search_filter_id'] = 452;
    $the_query = new WP_Query($args);
    
    // The Loop
    if ( $the_query->have_posts() ) {
      while ( $the_query->have_posts() ) {
        $the_query->the_post();
    ?>
    
    <div>
      <a href="<?php the_permalink(); ?>">										
      <h3><?php the_title(); ?></h3>
      <h4>By <?php the_author(); ?></h4>
      </a>
    </div>
    
    <?php }
      // wp_reset_postdata();
    } else {} ?>
    
    $big = 999999999;
    
    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' => $the_query->max_num_pages,
    ) );
    Anonymous
    #153547

    I should add that the filter shortcode is above all the code previously posted:

    <?php echo do_shortcode('[searchandfilter id="452"]') ?>

    Trevor
    #153561

    What is it that you are trying to achieve/change with your code compared to our pagination code?

    Anonymous
    #153576

    Everything is already set up and styled with my existing code. The client wanted to add in the filter after it was complete. So, it’s partially to save time, and partially because I can’t seem to find whether S&F has a numerical pagination option.

    Trevor
    #153582

    Ah. I think you will still need to use our pagination as it is and style it. If you are using our Shortcode Results method, that is coded to use styling from the WP-PageNavi plugin if also installed. That then gives the numbering and styling options.

    Anonymous
    #153584

    Very good to know. Thank you!

Viewing 6 posts - 1 through 6 (of 6 total)