title: Using "Advanced Custom Fields" checkbox fields in custom queries
body: <p>I’m trying to write a WP_Query which uses some data from two ACF checkboxes as part of the arguments.</p>
  
  <p>I found the documentation showing how to use fields in custom queries however I cannot work out what the correct syntax for my checkboxes is.</p>
  
  <p>My ACF’s:</p>
  
  <ul>
  <li>Label: Promote to homepage?</li>
  <li>Name: promote_to_homepage</li>
  <li>Choices: Promoteto homepage : Promote to homepage</li>
  <li>Label: Make feature?</li>
  <li>Name: make_feature</li>
  <li>Choices: Show as feature : Show as feature (top of homepage)</li>
  </ul>
  
  <p>This is the query I have:</p>
  
  <pre><code>$the_query = new WP_Query(
     array
        (
           'posts_per_page' =&gt; 1,
           'meta_key' =&gt; 'promote_to_homepage',
           'meta_value' =&gt; 'Promote to homepage',
           'meta_key' =&gt; 'make_feature',
           'meta_value' =&gt; 'Make feature'
        )
  );
  </code></pre>
  
  <p>I guess what I can’t figure out is why data is actually needed for <code>meta_key</code> and <code>meta_value</code>. Is the key the label? Is the value one of the choices? Or do I need to use <code>meta_value =&gt; true</code> or something? I have tried many variations and cannot get it to work.</p>
  
  <p>Essentially what I want to do is output the most recent post that is checked for “Promote to homepage” and “Make feature”.</p>
  
  <p>I have also tried:</p>
  
  <pre><code>array
     (
        'posts_per_page' =&gt; 1,
        'meta_key' =&gt; 'promote_to_homepage',
        'meta_value' =&gt; true,
        'meta_key' =&gt; 'make_feature',
        'meta_value' =&gt; true
  )
  </code></pre>
  
  <p><strong>Edit</strong></p>
  
  <p>This is the new code I have tried:</p>
  
  <pre><code>    $args = array(
          'post_type' =&gt; 'post',
          'posts_per_page' =&gt; 1,
          'meta_query' =&gt; array(
          'relation' =&gt; 'AND',
              array(
                  'key' =&gt; 'promote_to_homepage',
                  'value' =&gt; true,
              ),
              array(
                  'key' =&gt; 'make_feature',
                  'value' =&gt; true,
              ),
          )
       );
  
      $the_query = new WP_Query($args);
  
     if ( $the_query-&gt;have_posts() ) {
        while ( $the_query-&gt;have_posts() ) {
              $the_query-&gt;the_post();
              echo '&lt;h2&gt;' . get_the_title() . '&lt;/h2&gt;';
              echo '&lt;p&gt;' . get_the_excerpt() . '&lt;/p&gt;';
              echo '&lt;p&gt;&lt;a href="#" class="read-more"&gt;Read more&lt;/a&gt;&lt;/p&gt;';
          }
      }
      wp_reset_postdata();
  </code></pre>