Orderby two custom fields in same column
-
Hey,
I have a list of posts, one of the columns is populated with one of two different custom fields, one is a regular custom field and the other is a post object field pointing to another custom post type.
I want that column to be in alphabetical order. The query I have come up with so far is: (but stil not in correct order..)
customer_name is the post object of which the title of post that is displayed.
quick_customer_name is a regular custom field.'meta_query' => array( 'relation' => 'OR', 'customer_name' => array( 'key' => 'customer_name', 'compare' => 'EXISTS', ), 'quick_customer_name' => array( 'key' => 'quick_customer_name', 'compare' => 'EXISTS', ), ), 'orderby' => array( 'customer_name' => 'desc', 'quick_customer_name' => 'desc', ) );
Anyone have an idea of what I am doing wrong?
All help is very appriciated!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Orderby two custom fields in same column’ is closed to new replies.