Pagination doesn't work

Forums › Forums › Search & Filter Pro › Pagination doesn't work

Viewing 4 posts – 1 through 4 (of 4 total)
  • Anonymous
    #22597

    Here is my website with filters
    http://skillgen.eu/pl/sklep/
    filters work pretty well, but there is a problem with pagination. When I use a filter, pagination doesn’t work. Try to check “Psychologia zarządzania” for example.
    I created a file archive-filter.php, I put the pagination in there:

    <div class="pagination">
    	<?php
    	global $wp_query;
    				
    	$big = 999999999; // need an unlikely integer
    				
    	echo paginate_links( array(
    	'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
    	'format' => '?paged=%#%',
    	'current' => max( 1, get_query_var('paged') ),
    	'total' => $wp_query->max_num_pages
    	) );
    	?>
    	</div>

    In the settings I have Results per page: 15
    Here are my other settings:
    http://clivio.pl/skillgenpag.png

    I searched forum but there is so much information about pagination that I could spend the whole day 🙂 I looked through a lot of it but I haven’t found solution to my problem.

    Ross Moderator
    #22626

    Hey Katarzyna

    I’m not sure what could be causing that, possibly another plugin interfering with the pagination process.

    You could try using the wp-page-navi plugin instead as I’ve known that to work.

    In S&F 2.0 I’ve rewritten how pagination works quite a bit so again, this may overcome your issues – I can send you the beta version to test if you like?

    Thanks

    Anonymous
    #22666

    I’ve managed to get pagination to work. In “Set a slug” option I added a slug “filter” and pagination started working.
    But there is another problem – I want to display the number of retrieved items in the parenthesis next to the “Sklep” title. It works on my shop page, but when I enter the filter, it shows only 15 (number of items visible on the current page) – it doesn’t show all the items.
    Maybe the plugin provides some function that counts retrieved items?
    My function counting posts looks like this:

    function skg_get_posts_count() {
        global $wp_query;
        return $wp_query->post_count;
    }
    Anonymous
    #22667

    After I wrote to you, I have immediately found a solution. I have used this code:

    global $wp_query;echo $wp_query->found_posts;

    So at the moment that would be all, thank you very much for the quick response 🙂

Viewing 4 posts – 1 through 4 (of 4 total)

Search & Filter Support
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

We also use cookies to store items in your cart as well as allowing your to login on the site.

You can adjust all of your cookie settings by navigating the tabs on the left hand side.

By continuing to use this site, you also agree to our Privacy Policy.