If I do a search example.com/?s=london with no wp_query I get results and I can change pages. But if I add a wp_query and do the same search example.com/?s=london if I click to page 2 example.com/page/2/?s=london I get a 404. Also with a wp_query added if I do a blank search and change pages example.com/page/2/?s= i dont get 404. Its seems that the searched word is doing it but I'm not sure why. Ive tried changing my permalinks so they update but still get the same. This is the wp_query I'm using so you can see.
<?php
$args_a = array(
'post_type' => 'post',
'meta_query' => array(
array(
'key' => 'CurrentLocation',
'value' => $searchm,
'compare' => '=',
),
array(
'key' => 'AreaLookingFor',
'value' => $areaihave,
'type' => '',
'compare' => '=',
),
),
'paged' => get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1,
);
$query_a = new WP_Query( $args_a ); ?>
<?php if ( $query_a->have_posts() ) : ?>
<?php while ( $query_a->have_posts() ) : $query_a->the_post();
get_template_part( 'template-parts/post/content', 'excerpt' );
endwhile; ?>
next_posts_link( 'Next', $query_a->max_num_pages );
previous_posts_link( 'Previous' ); ?>
<?php wp_reset_postdata(); ?>
<?php else : ?>
<p><?php _e( 'No homes matched your criteria' ); ?></p>
<?php endif; ?>