Pagination problem with query vars
-
The pagination breaks when query variables are involved. For example, a search results page with just a search term paginates correctly, but a search for
example.com/?s=ipsum&cat=3
becomesexample.com/?s=ipsum&cat=3#038;cat=3&paged=2
in the pagination.The problem is in the
vantage_pagination()
function: it uses a wrongbase
value forpaginate_links()
:echo paginate_links( array(
'total' => $pages,
'current' => $paged,
'mid_size' => $showitems,
'format' => ( $wp_rewrite->permalink_structure == '' || is_search() ) ? $format_query_string : $format_permalink,
'base' => get_pagenum_link( false ) . '%_%',
) );The fix is simple: you need to disable the escaping in
get_pagenum_link()
withget_pagenum_link( false, false )
– that way the URLs work.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.