Forums › Forums › Search & Filter Pro › Pagination on custom page
Tagged: pagination
- This topic has 5 replies, 2 voices, and was last updated 3 years, 10 months ago by Trevor.
-
Anonymous(Private) December 30, 2020 at 4:50 pm #271364
Hi,
I have set a search form for a custom page.Everything is ok with the infinite scroll setting. But, with pagination, clicking on pagination links keep reloading the first 6 elements.
Here is my code :
<div class="videos flex flex__wrap" id="ajax-results"> <?php $paged = ( get_query_var( 'paged' ) ) ? absint( get_query_var( 'paged' ) ) : 1; do_action("search_filter_query_posts", 1605); while(have_posts()): the_post(); echo '<div>'; get_template_part('parts/portrait', 'box'); echo '</div>'; endwhile; ?> </div> <div class="pagination"> <?php echo paginate_links( array( 'base' => str_replace( 999999999, '%#%', esc_url( get_pagenum_link( 999999999 ) ) ), 'current' => max( 1, get_query_var( 'paged' ) ), 'format' => '?paged=%#%', 'show_all' => false, 'type' => 'plain', 'end_size' => 2, 'mid_size' => 1, 'prev_next' => true, 'prev_text' => sprintf( '<i></i> %1$s', __( '←', 'text-domain' ) ), 'next_text' => sprintf( '%1$s <i></i>', __( '→', 'text-domain' ) ), 'add_args' => false, 'add_fragment' => '', ) ); ?> </div>
Could you help me please ?
ThanksTrevor(Private) December 30, 2020 at 5:20 pm #271369Are you able to send me a live link/URL to your search page so I can take a look?
Would you be opposed to using a free pagination plugin?
Have you looked at the exemplar results.php file in our plugin templates folder (designed for use with our shortcode method, but is editable – see our documentation at https://searchandfilter.com/documentation/search-results/using-a-shortcode/#customising-the-results) …
… and you could simply put your code into that (a lot of which you would not need).
-
AuthorPosts