Make WordPress Core

Opened 9 years ago

Closed 9 years ago

Last modified 7 years ago

#19833 closed defect (bug) (duplicate)

can not sort by 2 custom fields

Reported by: zied86 Owned by: zied86@…
Milestone: Priority: normal
Severity: blocker Version: 3.3.1
Component: Query Keywords:
Focuses: Cc:

Description (last modified by scribu)

I followed the syntax of the codex to sort by two criteria of custom fields, but unfortunately it does not work.


It accepts only one custom field:

$args = array(
'post_type' => 'post_type',
'posts_per_page' => '20',
'orderby' => 'custom_field1 custom_field2',	
'order' => 'ASC');

$query = new WP_Query( $args );

Change History (3)

#1 @scribu
9 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

#2 @scribu
9 years ago

  • Description modified (diff)

This ticket was mentioned in IRC in #wordpress-dev by SergeyBiryukov. View the logs.

7 years ago

Note: See TracTickets for help on using tickets.