WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Bainternet assisted me earler with the relation AND parameter. What I need to do now is determine how to query multiple vales from a single key. If I try to specify two arrays with the same key the query fails. Is there a way to use an array in the value?Something similar to.

'value' => array( 'Install Manual', 'User Manual' ),

I've searched quite a bit with no results. This is where I'm at so far.

$documents = array(
    'post_type' => 'documents',
    'meta_query' => array(
    'relation' => 'AND',
            'key' => 'document-type',
            'value' => array( 'Install Manual', 'User Manual' ),
            'key' => 'document-status',
            'value' => 'current',
query_posts( $documents );
get_template_part( 'loop', 'documents' );
share|improve this question
up vote 2 down vote accepted

Just add 'compare' => 'IN':

        'key' => 'document-type',
        'value' => array( 'Install Manual', 'User Manual' ),
        'compare' => 'IN'
share|improve this answer
Awesome thank you! Is there a document somewhere that explains all the different compares available and what they do? – Zach Shallbetter Aug 3 '11 at 22:43
Here you go: codex.wordpress.org/Class_Reference/… I think they're pretty self explanatory, well except BETWEEN and NOT BETWEEN. – scribu Aug 3 '11 at 22:49

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.