sort by two meta keys
<p>I'm trying to order data with two meta keys but I'm not able to do
that.</p>

<p>This code is not working for me:</p>

<pre><code> $args= array(
  "post_type" =&gt; "post_type",
  "post_status" =&gt; "publish",
  'meta_query'    =&gt; array(

                            array(
                                'key'     =&gt; 'keyname1',
                                'orderby' =&gt; 'meta_value_num',
                                'order' =&gt; DESC,
                            ),
                                 array(
                                'key'     =&gt; 'keyname2',
                                'orderby' =&gt; 'meta_value_num',
                                'order' =&gt; DESC,
                            ),

),


  "posts_per_page" =&gt; 10
);
</code></pre>

<p>This code works for the single key perfectly, but not for the two keys:</p>

<pre><code>$args=array(
      "post_type" =&gt; "post_type",
      "post_status" =&gt; "publish",
      "orderby" =&gt; array(
      "meta_value_num" =&gt; "DESC",
      "rand" =&gt; "ASC" ),
      "meta_key" =&gt; "keyname",);
</code></pre>

<p>How can I do this?</p>