You can force WordPress to load search.php template when you need it by using the following code:
add_filter( 'template_include', 'get_search_template' );
instead of
$q->set( 'is_search', true );
You can force WordPress to load search.php template when you need it by using the following code:
add_filter( 'template_include', 'get_search_template' );
instead of
$q->set( 'is_search', true );