Support

Account

Home Forums General Issues Query and Orderby multiple ACF Fields Reply To: Query and Orderby multiple ACF Fields

  • In order to order by multiple meta values you need to use clauses. Information on this is not given in the main WP_Query doc but can be found here https://make.wordpress.org/core/2015/03/30/query-improvements-in-wp-4-2-orderby-and-meta_query/

    basically you need to replace 'meta_key' => 'property_status' with a full meta_query and include all of the field names you want to order by in it. These meta queries can be all simple “EXIST” queries if your only goal is to order by the fields.

    your “orderby” array would then be similar to what you have but use the clause index for each of the fields instead of the field name.