In WP there is an arbitrary top_partner (true/false) field top_partner (true/false) , I want all the records on the page to be sorted by this field, if true then these records are at the top, if false then the records are at the bottom.
$query = new WP_Query(array( 'post_type' => 'partner', 'posts_per_page' => -1, 'meta_key'=> 'top_partner', 'orderby' => 'meta_value', 'order' => 'DESC', 'tax_query' => array( array( 'taxonomy' => 'partner-city', 'field' => 'term_id', 'terms' => $category->term_id, //'operator'=> 'NOT IN' ) ) ) ); $posts = $cat = array(); while ($query->have_posts()) { $query->the_post(); //the_post(); $post = $query->post; //$taxonomies = wp_get_post_categories($post -> ID); print_r($post); exit; $categories = get_the_terms($post -> ID, 'partner-city'); if(count($categories) > 0){ foreach ($categories as $key => $value) { if($value->parent==$category->term_id || $value->term_id==$category->term_id) $posts[$value->name][] = $post; } }else $posts[$category->name][] = $post; } but this way I only see entries in which top_partner in labor. What needs to be changed in order to display the rest of the records? 