You have a typo in your $advtxtQuery
query– $where =" (( post_typs LIKE 'projects')...
For the rest, both queries are searching on the same key so use IN
instead of trying to create two separate arrays, as in the Codex example below:
$args = array(
'post_type' => 'my_custom_post_type',
'meta_key' => 'age',
'orderby' => 'meta_value_num',
'order' => 'ASC',
'meta_query' => array(
array(
'key' => 'age',
'value' => array(3, 4),
'compare' => 'IN',
)
)
);
$query = new WP_Query($args);
You could just pass your $category
as is but I’d filter it for maliciousness. In fact, your values are (or seem to be) static so the safest thing is to do this:
$category_args = array();
if(!empty($category[0])) $category_args[] = "Planet";
if(!empty($category[1])) $category_args[] = "People";
And pass that into your query like so:
if( !empty($category_args) ){
if(!isset($argsearch["meta_query"])){
$argsearch["meta_query"] = array();
}
$argsearch["meta_query"][] = array(
'key' => '_cmb_project_category',
'value' => $category_args,
'compare' => 'IN'
);
}