Home › Forums › General Issues › WP Query Order By Issue › Reply To: WP Query Order By Issue
I was working through a similar issue based on the advice from this post and something like this example may work for you. In my case, it was a true/false field then a custom date.
$args = array(
'post_type' => 'Property', // post type
'meta_query' => array(
borough_clause => array(
'key' => 'the_borough',
),
order_clause => array(
'key' => 'the_order',
),
),
'orderby' => array(
'borough_clause' => 'ASC', // assuming borough alphabetical
'order_clause' => 'ASC' // assuming custom order is 1 2 3 etc
),
'posts_per_page' => -1, // inlcude if you want all posts
));
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.