i would like to sort my posts first by “time” meta value and secondly by “clicks” meta value.So if 2 posts have the same “time” the one with less clicks will go first.
$args=array(
'post_type' => 'post',
'category_name' => 'players',
'order' => 'ASC',
'meta_key' => 'times',
'posts_per_page'=> '15',
'orderby' => 'meta_value_num',
'offset' => $offsetnumber
);
You can hook into the
posts_orderby
filter to customize the sql query to sort by multiple fields.Some details here:
http://jeffgran.com/262/blog/wordpress-sort-posts-by-multiple-fields-part-ii