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)