pagination links is causing 404 when i combine taxonomy filter

Question

Hi i have created a custom archive page and i created my custom post type using CPT
I manage to add pagination but i have also create a filter using custom taxonomy and when i use the filter with pagination my site is returning 404
for example mypage/myarchive/?paged=2&color[]=red&color[]=blue

this is the code i use for pagination

if( $wp_query->max_num_pages > 1 ) {
echo paginate_links( array(
   'total'        => $wp_query->max_num_pages,
   'current'      => max( 1, get_query_var( 'paged' ) ),
    'format'       => '?paged=%#%',
   'end_size'     => 2,
   'mid_size'     => 1,
   'prev_next'    => true,
   'prev_text'    => sprintf( '<i class="fas fa-chevron-left"></i>' ),
   'next_text'    => sprintf( '<i class="fas fa-chevron-right"></i>' ),

) ); 
}
0
Wilmar Arias 2 months 0 Answers 9 views 0

Leave an answer