Forums Forums Search & Filter Pro Pagination not working properly

Viewing 6 posts - 1 through 6 (of 6 total)
  • Anonymous
    #247748
    This reply has been marked as private.
    Trevor
    #247803

    I can see that you are using the ‘Custom’ display results method, so how did you link our search form the the results grid on the page?

    Anonymous
    #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
    #247823

    The 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"]

    Anonymous
    #247850

    I added id to the section, pagination is working better now, but when filter by genre/category pagination count is still same.

    Trevor
    #247971

    That 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.

Viewing 6 posts - 1 through 6 (of 6 total)