I have a custom loop to display a custom post type 'properties
' . The idea is to search properties based on different search parameters selected by users. Now the weird problem I am facing is that if the number of the search parameters increases to 7 the WP_Query doesn't return any results at all.
The properties with these search parameters exsit in the WP Backend . If I remove any of the one search parameter to make it less than 7 it displays the results. But as soon the number of parameters goes up it wont display any result.
What I am doing wrong ?
Here is the meta query array:
(
[0] => Array
(
[key] => payment_status
[value] => yes
)
[1] => Array
(
[key] => expired
[value] => no
)
[2] => Array
(
[key] => listing_type
[meta_value_num] => Array
(
[0] => 1
[1] => 2
[2] => 3
)
)
[3] => Array
(
[key] => available_for
[value] => sale
)
[4] => Array
(
[key] => country
[value] => Saudi Arabia
)
[5] => Array
(
[key] => city
[value] => Riyadh
)
[6] => Array
(
[key] => property_type
[value] => land
)
[7] => Array
(
[key] => by
[value] => owner
)
)
As I said if I remove any of the parameters the results will display. Here is my WP_Query
function
$loop = new WP_Query(
array(
'post_type' => 'properties',
'posts_per_page' => (int)get_field(ICL_LANGUAGE_CODE.'_search_results_per_page',get_active_lang_id()),
'meta_query' => $meta_query,
'orderby' => 'date',
'order' => 'DESC' ,
'paged' =>$paged
));
Is it a known problem with WP_Query
that it doesn't display posts with large meta_query
set?
Any help would be appreciated
Ahmar