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.

codex: custom field parameters


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -