Forums › Forums › Search & Filter Pro › Pagination in Custom Display results method
- This topic has 3 replies, 2 voices, and was last updated 7 years, 4 months ago by Anonymous.
-
Anonymous(Private) June 22, 2017 at 11:21 am #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>
<?phpendif;
Trevor(Private) June 22, 2017 at 3:53 pm #116372Hi
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(Private) June 22, 2017 at 4:43 pm #116389You might also find this post/thread useful:
https://support.searchandfilter.com/forums/topic/pagination-not-working-properly/#post-108542
-
AuthorPosts