Conditional WP_query with Meta_query
-
I am trying to create a loop where posts are displayed from autor 1, or if the post contains metavalue in the field metakey.
I came up with below code, but I cant get it to work
$args = array( relation' => 'OR', array ('author' => 1 ), array ('meta_query' => array( 'key' => 'metakey', 'value' => 'metavalue', ) ) );
Also in case it works, will it show twice if match both author 1 AND the metavalue in metakey?
- The topic ‘Conditional WP_query with Meta_query’ is closed to new replies.