$params=array(
'showposts'=>2,
'post_status' => 'publish,pending',
'meta_key'=>'_needed',
'meta_value'=>'true'
);
$query = new WP_Query;
$my_results = $query->query($params);
Hi all,
I have the above query which selects 2 posts from my database that have the meta_key "_needed" set to "true".
I want to ORDER the results by another field of meta data. So what I want is to say:
$params=array(
'showposts'=>2,
'post_status' => 'publish,pending',
'meta_key'=>'_needed',
'meta_value'=>'true'
ORDER BY
'meta_key'=>'_date'
);
$query = new WP_Query;
$my_results = $query->query($params);
Is this possible??
Or can I select ALL with 1 query and then Order the results with another query?
Any ideas how I can achieve this??
Many thanks for any help you can give me.
Cheers
John ;-)