Pagination in Custom Display results method

Forums › Forums › Search & Filter Pro › Pagination in Custom Display results method

Viewing 4 posts – 1 through 4 (of 4 total)
  • Anonymous
    #116298

    Hi,

    I can’t make to work properly pagination with Custom Display results method. When I make click on a pagination link the page refresh correctly but pagination current link is not updated.

    I have this code:

    `
    <?php

    // pagination
    $paged = ( get_query_var( ‘paged’ ) ) ? absint( get_query_var( ‘paged’ ) ) : 1;

    $args = array(
    ‘posts_per_page’ => 9,
    ‘paged’ => $paged,
    ‘post_type’ => $cpt,
    ‘order’ => ‘ASC’,
    ‘orderby’ => ‘menu_order’,
    ‘search_filter_id’] = 123
    );

    // query
    $the_query = new WP_Query( $args );

    // loop
    if ( $the_query->have_posts() ):
    // show posts

    ?>
    <div class=”pagination”>
    <?php
    echo paginate_links(
    array (
    ‘current’ => max( 1, $paged ),
    ‘total’ => $the_query->max_num_pages,
    )
    );
    ?>
    </div>
    <?php

    endif;

    Trevor
    #116372

    Hi

    As you are making your own template, you need to refer to the WordPress Codex for making pagination. In our plugin folder, you will find a folder called templates and in that is a sample results.php template, which shows fairly standard pagination code. A plugin called WP-PageNavi is also a really good example of how to code it.

    Trevor
    #116389
    Anonymous
    #116523

    Solved, the problem was that .pagination was not inside display results ajax container.

Viewing 4 posts – 1 through 4 (of 4 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.