Thank you John, this solved my problem. I’m posting the updated code here for others to see. What i did is make the feature part of my meta_query and declare an index for “feature_clause” that just checks to see if the field exists. Then i added that to the “orderby” array including “date”, so both are sorted together. Here’s the updated query:
$review_args = array ( 'post_type' => 'customer_reviews', 'posts_per_page' => 20, 'post_status' => 'publish', 'meta_query' => array( 'relation' => 'AND', 'feature_clause' => array( 'key' => 'featured', 'compare' => 'EXISTS', ), ), 'orderby' => array( 'featured' => 'DESC', 'date' => 'DESC', ), 'fields' => 'ids' );
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!
© 2022 Advanced Custom Fields.