Thanks in advance for the help. I'm trying to write a query_posts statement for Wordpress in which:
$args = 'meta_query' => array (
array (
array ('key' => 'key-type-1',
'value' => 'something'
),
array ('key' => 'key-type-2',
'value' => 'something'
)
)
OR
array (
array ('key' => 'key-type-3',
'value' => 'something'
),
array ('key' => 'key-type-4',
'value' => 'something'
)
)
);
query_posts( $args );
So as you can see, there is a hole in my understanding here :) I am trying to write a scenario in where either can be true: EITHER a value for key-type-1 AND key-type-2 exists, OR a value for key-type-3 AND key-type-4 exists.
I've tried the obvious:
$args = 'meta_query' => array (
array (
array ('key' => 'key-type-1',
'value' => 'something'
),
array ('key' => 'key-type-2',
'value' => 'something'
)
),
array (
array ('key' => 'key-type-3',
'value' => 'something'
),
array ('key' => 'key-type-4',
'value' => 'something'
)
)
);
query_posts( $args );
But that just produces: A value for key-type-1 AND key-type-2 exists AND a value for key-type-3 AND key-type-4 exists... Which is no good.
Maybe a 'compare' value in each of the sub arrays? Or maybe I have to resort to using multiple query_posts and combining the multiple outputs on display? If anyone has any insights, it would really help me out.
Thanks!