Quantcast
Channel: Toolset » All Posts
Viewing all articles
Browse latest Browse all 20145

Reply To: Pagination is clearing the filter?

$
0
0

THE ISSUE IS CUSTOM PAGINATION CODE

Hi again,

I've found the problem. It is the custom pagination code.

Here is the code Luoy kindly provided to allow limiting of the number of pages:

	function paginate_links_func($atts='') {
	global $WP_Views;
	$page = $WP_Views->get_current_page_number();
	$add_args = array(
		'wpv_view_count'=>$WP_Views->get_view_count()
	);
	$args = array(
		'base' => '%_%',
		'format' => '?wpv_paged=%#%',
		'total' => $WP_Views->get_max_pages(),
		'current' => $page,
		'show_all' => False,
		'end_size' => 1,
		'mid_size' => 4,
		'prev_next' => True,
		'prev_text' => __('« Previous'),
		'next_text' => __('Next »'),
		'type' => 'plain',
		'add_args' => $add_args,
		'add_fragment' => false
	);
	return paginate_links( $args );
}
add_shortcode('paginate-links', 'paginate_links_func');

Was provided in this thread: http://wp-types.com/forums/topic/limit-the-number-of-page-links-in-the-pagination/

You can see in this test page the default pagination is working ok: http://nationalparktraveller(dot)com/test-np-view-v2/

But in this one using the custom pagination code it is not: http://nationalparktraveller(dot)com/test-np-view

please replace (dot) with '.' to make the links work.

Does the custom code look like it should work with filter settings?

Thanks for your help
Nick


Viewing all articles
Browse latest Browse all 20145

Trending Articles