Query 2 Meta Keys and display posts which has those 2 meta keys only
-
Hey Guys, I was wondering if any of you could help me.
I need to query multiple meta keys and display posts only when the post has both of those meta keys.
If its featured (meta_value=yes) and has a meta key which has a values of ‘event’ it should be displayed, but if it wasn’t featured it wouldn’t display, but if it was featured and had a meta_key which was ‘party’ I would not and vice versa.
'relation' => 'AND', array( 'key' => array('cc_add_type'), 'value' => array('pro'), 'compare' => '=', ), array( 'key' => array('parish'), 'value' => $_GET['parish'], 'compare' => '=', )
I tried the code above, but it is displaying them if it has one or the other.
Sorry if this doesnt make sense, tried to explain it the best i could.
Thanks.
- The topic ‘Query 2 Meta Keys and display posts which has those 2 meta keys only’ is closed to new replies.