show posts with range meta key
You can compare BETWEEN in the meta_query and you need to set the type too for NUMERIC. For example $args = array( ‘post_type’ => ‘my_custom_post_type’, ‘meta_key’ => ‘age’, ‘orderby’ => ‘meta_value_num’, ‘order’ => ‘ASC’, ‘meta_query’ => array( array( ‘key’ => ‘age’, ‘value’ => array( 5, 10 ), ‘compare’ => ‘BETWEEN’, ‘type’ => ‘NUMERIC’ ) )); … Read more