Pagination appends search query
-
I have created a custom search form. That works perfectly.
I have added pagination. That also works (almost) perfectly.
Now if I have the following search query/url
https://domain.com/?s=&ssd=1&spid=home&sex%5B%5D=4Then the pagination link for the second page is
https://domain.com/page/2/?s&ssd=1&sex%5B0%5D=4#038;ssd=1&sex%5B0%5D=4This part gets added: #038;ssd=1&sex%5B0%5D=4
But I have no clue as to why.This is my pagination function:
function get_paging() { global $wp_query; if ( $wp_query->max_num_pages < 2 ) { return false; } $big = 999999999; $args = array( 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), 'format' => '/page/%#%', 'total' => $wp_query->max_num_pages, 'current' => max( 1, get_query_var( 'paged' ) ), 'show_all' => false, 'end_size' => 3, 'mid_size' => 2, 'prev_next' => true, 'prev_text' => __( '« Previous', 'sexdates' ), 'next_text' => __( 'Next »', 'sexdates' ), 'type' => 'list', ); return sprintf( '<div class="paginator">%s</div>', paginate_links( $args ) ); }
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Pagination appends search query’ is closed to new replies.