Forums › Forums › Search & Filter Pro › Pagination not working properly
Tagged: pagination not working
- This topic has 6 replies, 2 voices, and was last updated 4 years, 5 months ago by Trevor.
-
Anonymous(Private) June 8, 2020 at 11:35 am #247813
Set it in WP_QUERY.
<ul id="home-movies-post" class="MovieList Rows AX A04 B03 C20 D03 E20 Alt"> <?php $paged = isset($wp_query->query['paged']) ? $wp_query->query['paged'] : get_query_var('paged'); $args = array( 'posts_per_page' => $number_movies, 'post_type' => array('movies', 'series'), 'post_status' => 'publish', 'search_filter_id' => '840' ); $the_query = new WP_Query($args); if ($the_query->have_posts()): while ($the_query->have_posts()): $the_query->the_post(); get_template_part("public/partials/template/loop-principal"); endwhile; endif; wp_reset_query(); ?> </ul> <nav class="wp-pagenavi"> <?php echo TOROFLIX_Add_Theme_Support::toroflix_pagination(); ?> </nav>
Trevor(Private) June 8, 2020 at 12:04 pm #247823The issue may be that the Ajax Container,
#home-movies-post
, does not included the pagination. It would need to be this HTML element, but, it does not have a class or id name:https://www.screencast.com/t/J1IUte4dg84
It MIGHT be that this would work as the Ajax Container (I am not sure):
section[data-id="movies"]
Trevor(Private) June 9, 2020 at 9:22 am #247971That suggest that this line is not being called again (at least it isn’t working):
<?php echo TOROFLIX_Add_Theme_Support::toroflix_pagination(); ?>
I can see that it is inside a div that suggests, to me, that WP-PageNavi is being used. Is that installed as a plugin in your site?
If you look in our plugin folder, you will find a sub folder named ‘templates’. Inside that is a file named results.php, and that too has sample code on how to call WP-PageNavi:
<div class="pagination"> <div class="nav-previous"><?php next_posts_link( 'Older posts', $query->max_num_pages ); ?></div> <div class="nav-next"><?php previous_posts_link( 'Newer posts' ); ?></div> <?php /* example code for using the wp_pagenavi plugin */ if (function_exists('wp_pagenavi')) { echo "<br />"; wp_pagenavi( array( 'query' => $query ) ); } ?> </div>
It may be that you have to bring whatever function is actually being called by your code to actually site inside the template, rather than calling it in.
-
AuthorPosts