title: Ordering Wordpress posts with meta values
body: <p>I have this code below that basically creates 4 links to allow me to sort posts on the front end.</p>
  
  <pre><code>        &lt;div class="sort"&gt;
              Sort projects by:
              &lt;a href="http://mydomain.com/find-work/" &gt;Latest Projects&lt;/a&gt;
              &lt;a href="http://mydomain.com/find-work/?order=asc&amp;orderby=date" &gt;Ending Soon&lt;/a&gt;
              &lt;a href="http://mydomain.com/find-work/?order=asc&amp;orderby=meta_value_num&amp;meta_key=proj_budget" &gt;Budget Low&lt;/a&gt;
              &lt;a href="http://mydomain.com/find-work/?order=desc&amp;orderby=meta_value_num&amp;meta_key=proj_budget" &gt;Budget High&lt;/a&gt;
          &lt;/div&gt;
  
          &lt;?php   $my_query = new WP_Query( array( 
                          'post_type' =&gt; 'project',
                          'orderby' =&gt; get_query_var('orderby'),
                          'order' =&gt; get_query_var('order'),
                          ));      
                  while ( $my_query-&gt;have_posts() ) : $my_query-&gt;the_post(); ?&gt;
  </code></pre>
  
  <p>The second link, ordering by date works fine but the two links to order by meta values is not working. I am obviously missing something in my query but for the life of me can't work it out.</p>
  
  <p>Any ideas??</p>