Home › Forums › General Issues › Sort order of several ACF Fields › Reply To: Sort order of several ACF Fields
You have to use a meta query with multiple values and clauses.
See the example of using clauses on the documentation for WP_Query() Order & Orderby Parameters. The example is titled “‘orderby’ with multiple ‘meta_key’s” and is currently the 10th example given.
Note, in your case you would use “EXISTS” for the compare setting on both meta keys.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.