Fortunately, Meta Box has another interesting extension named Meta Box Conditional Logic that can do it. ; Using the class WP_Query: This way, you will have an instance of WP_Query and you can perform the query yourself. Getting posts. NOT REGEXP (WordPress >= 3.7) – Similar to REGEXP but meta values must not match your given regular expression; RLIKE (WordPress >= 3.7) – it is the synonym to REGEXP; How to Use "compare => between" for Dates in meta_query. There are two ideal ways to get posts: get_posts: This function simply creates an instance of WP_Query then returns an array of post objects. However, Group Field’s nature does not include assigning a field can be displayed based on another field’s value (but Flexible Content Field of ACF has). Before learning how to get posts by custom fields, you have to know how to get posts. You can also use meta_query to check if a custom field is between two dates..