#29666 closed defect (bug) (invalid)
Mulitiple orderby/order pairs
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | 4.0 |
| Component: | Query | Keywords: | |
| Focuses: | Cc: |
Description
In documentation: http://codex.wordpress.org/Class_Reference/WP_Query
Chapter: Mulitiple orderby/order pairs
this code does not work,
sorts only on one field
$the_query = new WP_Query (
array (
'posts_per_page' => -1,
'cat' => $ccat->cat_ID,
'orderby' => array (
'meta_value_num' => 'DESC',
'title' => 'ASC',
),
'meta_key' => 'count',
)
);
Change History (3)
#2
@
12 years ago
- Keywords close added; reporter-feedback removed
- Resolution set to invalid
- Status changed from new to closed
Sorry, I probably made a mistake.
I wanted to get this result.
| post_title | postmeta - count |
|---|---|
| Edge Case: Nested And Mixed Lists | 10 |
| Markup: Image Alignment | 1 |
| Media: Twitter Embeds | 14 |
| Hello world! | 0 |
| Post Format: Video (VideoPress) | 0 |
| Template: Featured Image (Vertical) | 0 |
Note: See
TracTickets for help on using
tickets.
I tried out the code on the following data and it worked fine for me:
This is the result I got:
Maybe your count field has unique values?