How to filter multiple queries with search?

When I do a search on my theme, it only filters the main query…

It’s exactly how it should do. The url change only the main query (or better, the main query in the one fired by args in the url).

If you have secondary query on same page, they continue to work using the args that you pass to WP_Query.

So if you want secondary query also use the s param, pass it as argument.

$args = array(
  // ... you have your query args here ...
);

// next line check the main query for the 's' argument and if present add it to args
if ( get_query_var('s') ) $args['s'] = get_query_var('s');

$secondary_query = new WP_Query( $args );

// your loop here

error code: 523