title: How to combine meta_query and orderby date meta in WordPress?
body: <p>I have 3 meta fields, date (date formatted string), location, and consultant.</p>
  <p>I can pull the posts and orderby the date field when meta_key is set:</p>
  <pre><code>// get posts
  $posts = get_posts(array(
      'post_type'     =&gt; 'event',
      'posts_per_page'    =&gt; -1,
      'meta_key'      =&gt; 'start_date',
      'orderby'       =&gt; 'meta_value_num',
      'order'         =&gt; 'DESC'
  ));
  </code></pre>
  <p>However, I have not be able to get this to work with a more complex <code>meta_query</code>:</p>
  <pre><code>$args = array(
      'post_type' =&gt; 'uppy_events',
      'orderby'       =&gt; 'meta_value_num',
      'order'         =&gt; 'ASC',
  
      'meta_query' =&gt; array(
          array(
              'key' =&gt; $key,
              'value' =&gt; array($value),
              'compare' =&gt; '&gt;='
              )
          ),
          'numberposts' =&gt; -1
      );
  </code></pre>
  <p>Basically I want to pull all posts that have a meta <code>start_date</code> greater than today's date and order by these dates.</p>
  <p>As a side note - can you do a <code>meta_query</code> search on say location key and still orderby date key?</p>
  <p>This is the first time I've ever tried ordering by meta, and have found some good posts but still cannot wrap my head around it.</p>