The way you have built that query it is possible for you to have a bunch of empty values. For example, if grad
is not present then you end up searching ex_lokacija
keys for empty strings. Since your main relation is AND
all of the terms have to ‘hit’ so it seems likely to me that it would be very hard to get a query that returns anything. I would build the query to only search keys that have values.
$meta_query = array();
if (!empty($grad)) {
$meta_query[] = array(
'key' => 'ex_lokacija',
'value' => $grad ,
'compare' => 'LIKE'
)
}
// and so on for each of your keys, then
$args = array(
'post_type' => 'post',
'relation' => 'AND',
'meta_query' => $meta_query
)
$searched_posts = new WP_Query( $args );