php - Wordpress meta query with multiple key value pairs and relations -
i have following problem. on wordpress page there small sticky posts , 1 big sticky post, fine. there regular posts , need not display posts marked sticky or big sticky meta value.
i need query value not true or doesn't exist home_post
key , value not true or doesn't exist big_home_post
key.
the code came following:
'meta_query' => array( 'relation' => 'and', array( 'relation' => 'or', array( 'key' => 'big_home_post', 'value' => true, 'compare' => '!=' ), array( 'key' => 'big_home_post', 'value' => true, 'compare' => 'not exists' ), ), array( 'relation' => 'or', array( 'key' => 'home_post', 'value' => true, 'compare' => '!=' ), array( 'key' => 'home_post', 'value' => true, 'compare' => 'not exists' ), ), ),
the code not working.
maybe multidimensional array not built correctly or wordpress doesn't support @ all.
all appreciated
hüseyin babal's answer outdated. codex states:
starting version 4.1, meta_query clauses can nested in order construct complex queries.
so meta_query
value in question work.
Comments
Post a Comment