Pere Monfort Pàmies
asked 10 years ago

Pagination in “Search Results” page is NOT working with PERMALINKS activated.
It’s also failing on the DEMO page
To reproduce:

The link is “http://demo.designwall.com/dw-gamez/?s=apage/2/” instead of “http://demo.designwall.com/dw-gamez/page/2/?s=a”

1 Answers
Kido D
answered 10 years ago

Hi Pere,
Thanks for your feedback!
To resolve this issue, you can open up the template-tags.php in themes/dw-gamez/inc folder, find the code below (around line 42 & 60):

  if ( !$current_page = get_query_var('paged') ) $current_page = 1;
if ( is_home() ) {
$format = '?paged=%#%';
} else if ( !get_option('permalink_structure') ) {
$format = '&paged=%#%';
} else {
$format = 'page/%#%/';
}
$pagging = paginate_links(array(
'base' => get_pagenum_link(1) . '%_%',
'format' => $format,
'current' => $current_page,
'total' => $total,
'mid_size' => 4,
'type' => 'array',
'class' => 'pagination',
'prev_next' => ''
));

… and change it into this:

  if ( !$current_page = get_query_var('paged') ) $current_page = 1;
$base = get_pagenum_link(1) . '%_%';
if ( is_home() ) {
$format = '?paged=%#%';
} else if ( !get_option('permalink_structure') ) {
$format = '&paged=%#%';
} else {
$format = 'page/%#%/';
$paraUrl = explode('?', get_pagenum_link(1) );
$base = trailingslashit( $paraUrl[0] ) . '%_%';
if( count($paraUrl) > 1 ) {
$base .= '?';
foreach ($paraUrl as $key => $value) {
if( $key == 0 ) continue;
if( $key > 1 ) $base .= '&';
$base .= $value;
}
}
}
$pagging = paginate_links(array(
'base' => $base ,
'format' => $format,
'current' => $current_page,
'total' => $total,
'mid_size' => 4,
'type' => 'array',
'class' => 'pagination',
'prev_next' => ''
));

We’ll release an updated version of this theme soon. Thank-you!

Frank Pineda
replied 10 years ago

Hi Kido D,I’m having the same issue on this page:http://revistapetmi.com/preguntas-al-veterinarioI'm using a different theme from the one you mentioned above. How can I solve this?

Powered by DW Question & Answer Pro