Forums Forums Search & Filter Pro Numbered Paging

Viewing 3 posts - 1 through 3 (of 3 total)
  • Anonymous
    #47245

    Hi, I was wondering if your plugin works with numbered paging as well as standard ‘Next’/’Previous’ buttons built into the default template?

    I spotted you have it working on the WooCommerce demo but I am having trouble making it work on my site.

    I have used the following paginate_links() code to generate my page numbers…

    	<nav class="pagination numbered-paging">					
    		<?php 
    		$args = array(
    			'total'              => $query->max_num_pages,
    			'end_size'           => 2,
    			'mid_size'           => 2,
    			'prev_next'          => true,
    			'prev_text'          => __('Prev'),
    			'next_text'          => __('Next')
    		);
    		echo paginate_links( $args ); ?>
    	</nav>

    …which with 10 pages shows 1 (with ‘current’ class),2,3 … 9, 10, Next as expected. Clicking any of the page numbered links loads that page of results but the ‘current’ page always stays as 1. Even clicking the ‘next’ button always goes to page 2 regardless of which page you are on.

    And the ‘Prev’ button never appears as it always thinks you are on page one.

    In my form settings, my Pagination Selector is set to ‘pagination a’ (which I think was the default if I remember correctly).

    If you are able to advise if numbered pagination is possible that would be much appreciated. I can send you a private reply with a link to a dev server if that helps.

    Thanks,

    Paul

    Trevor
    #47277

    This is certainly within your theme that this is being made, and not by the S&F Pro plugin. My guess is that you are using the ‘as an Archive’ display method?

    Looking at the code, you need to find the function defined by your theme paginate_links

    Anonymous
    #47316

    Hi Trevor, thanks very much for the quick response.

    I figured out what was going on. the WordPress paginate_links(); function has an attribute for ‘current’ which defaults to 1. Changing the active page did not update this value so regardless of which page you were viewing the pagination always assumes you are on page 1.

    So I took the…

    $query->query['paged'];

    …that the template uses to display the current page number and fed that into the ‘current’ attribute so it now updates dynamically when the page changes.

    Thanks,

    Paul

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