Forums › Forums › Search & Filter Pro › PAGINATION: &sf_paged=%#% doesn't add to URL
Tagged: pagination
- This topic has 2 replies, 2 voices, and was last updated 8 years, 8 months ago by Anonymous.
-
Anonymous(Private) March 7, 2016 at 8:32 am #38791
Hi everybody,
I’ve set the code here below to have pagination in a custom search result page (search-games.php).
I can see the pagination links but all pointing to the first page. Looking at the URL I’ve seen that the “&sf_paged=%#%” it’s not added.Is there a way to solve the problem?
Thanks for your help.
Ronny— PAGINATION CODE —
global $wp_query;
$total = $wp_query->max_num_pages;
if ( $total > 1 ) {
// get the current page
if ( !$current_page = get_query_var(‘paged’) )
$current_page = 1;
// structure of “format” depends on whether we’re using pretty permalinks
if( get_option(‘permalink_structure’) ) {
$format = ‘&sf_paged=%#%’;
} else {
$format = ‘page/%#%/’;
}
echo paginate_links(array(
‘base’ => get_pagenum_link(1) . ‘%_%’,
‘format’ => $format,
‘current’ => $current_page,
‘total’ => $total,
‘mid_size’ => 4,
‘type’ => ‘list’,
‘prev_text’ => __(‘«’),
‘next_text’ => __(‘»’),
));
}Ross Moderator(Private) March 7, 2016 at 10:27 pm #38919Hey Ronny
Just had someone with the same issue, can you try my suggestions from:
https://support.searchandfilter.com/forums/topic/pagination-problems/#post-38913
First, just for testing, can you disable ajax?
Then check pagination again, does it work?
If not, there can sometimes be an issue with pagination.
There are several WP functions for getting pagination, so if one is not working, its worth trying another – in case there is a conflict with something in your setup.
Can you tell me, under the “display results” tab, what “display method” are you using?
Can you test out the other WP pagination functions?
the_posts_pagination
next_posts_link
|previous_posts_link
Thanks
-
AuthorPosts