You need the 2 digit month number that you want to query on and then use the code below. This should be easy with php (for example, see this post). In the code below $month
is the number of the month in a 2 digit format, eg March would be 03.
$start_date = date('Y'.$month.'01'); // First day of the month
$end_date = date('Y'.$month.'t'); // 't' gets the last day of the month
$meta_query = array(
'key' => 'event_start_date',
'value' => array($start_date, $end_date),
'compare' => 'BETWEEN',
'type' => 'DATE'
);
Related Posts:
- Changing the meta_query of the main query based on custom query_vars and using pre_get_posts
- Custom WP_Query order by post_meta and (author) user_meta
- Query WooCommerce orders where meta data does not exist
- Perform query with meta_value date
- Finding all results from database within 500 miles of the given latitude and longitude [closed]
- Use meta_query to display events by date in custom field
- How to show recent and upcoming birthdays using meta_query
- How to orderby meta_value_num with dollar ($) sign
- WP_Query meta_query >= date
- Optional Meta Query
- Overwrite YoastSEO meta-tags with another page’s [closed]
- How to orderby multiple meta fields if some fields are empty
- Meta Query relation “AND” then set array accordingly
- date_query seems to be ignored by wp_query
- Query post by date (stored custom field meta as yyyymmdd) and differentiate across 12 months
- How to set up hierarchical relationships without using plugins / meta query
- Is it possible to retrieve posts depending on meta_key LIKE condition? [duplicate]
- Show single posts date, in a page of posts
- Why doesn’t my WP Meta Query return any results?
- WP_Query meta compare must include ALL array values
- meta_query where the meta value is not the post title
- Query multiple post types, but different order for each
- Woocommerce Get Orders By Meta Value
- How to do WP_User_Query for Nested Array value Inside Nested Array field
- Comparing Meta Field date in WPQuery using Meta_Query?
- Meta query orderby meta_value_num sorting by role first
- Query against multiple locations within single custom post type post
- Strange results from WP_Query
- WP Query. Ordering posts by another post types meta
- Slow wp_posts and wp_postmeta query using Advance Custom Fields
- Query by meta value (add a dropdown of all values)
- Meta query doesn’t remove placeholder escape before query
- What is the best way to reset a search on a meta_key / meta_value?
- How can I modify standard search query to include also ACF custom fields values?
- Filter posts/pages by user_role array
- Query custom post type by date field only working when two posts match the query
- Divide WP_Query posts by date & post type
- Query Posts by date range with fixed beginning and end
- Get posts that were most recently tagged
- Use meta query only 3 or more results?
- Use value from meta key array for use in WP_Query
- How to use meta_query to retrieve posts from multiple custom post type
- WP_Query filtering in ACF field containing dates
- When should you use WP_Query vs query_posts() vs get_posts()?
- Meta_query compare operator explanation
- meta_query with meta values as serialize arrays
- Nested meta_query with multiple relation keys
- order by numeric value for meta value
- meta_query ‘compare’ => ‘IN’ not working
- Wp get all the sub pages of the parent using wp query
- Return only Count from a wp_query request?
- Use REGEXP in WP_Query meta_query key
- WP Query Args – Title or Meta Value
- How to query for most viewed posts and show top 5
- WP_Query orderby date not working
- Meta query with string starting like pattern
- compare meta_query in get_posts arguments
- How to query posts based on lat-lng coordinate as post meta?
- WP_Query vs get_posts
- how to show posts that are missing a meta_value
- Set Alias for meta_query arguments in get_posts()
- Sorting: custom query with orderby meta_value_num THEN by title
- WP_Comment_Query pagination, delving into the unknown
- Usage of the new “posts_clauses” filter in WordPress 3.1?
- Display products from specific category in shop page
- How can I query all users who registered today?
- Make a WP Query search match exactly the search term
- WP_Query() show posts that end later than today
- WP_Query: query posts by ids from array?
- How to Compare Two Meta Fields
- Meta Query with AND & OR?
- Sort posts by category name and title
- Does tax_query really beats meta_query in all situations?
- WP_Query with checkbox meta_query
- ACF Relationship Field Search Filtering [closed]
- How to uniquely identify queries?
- What is the most efficient way of querying posts based on visits and date for current day?
- Add indexing to meta_value in wp_postmeta
- Get Recent Posts by Date in Multisite
- Is it possible to orderby multiple meta_keys when using meta_value_num?
- Getting attachments by meta value
- Query Multiple Post types each with own meta query
- WP_Query for WooCommerce Products
- pre_get_posts with get_posts
- Execute a large WP_Query with many “AND” Meta_Queries?
- WordPress Custom Query to show posts from last x years
- Query all posts where meta value is empty
- author.php with ACF and CPTs
- WP_Query min and max values
- Query Custom Meta Value with Increment
- When should you use wp_reset_postdata vs wp_reset_query?
- Get posts by meta data OR title
- ACF datepicker meta_query Compare Dates in m/d/Y g:i a – Not in Ymd Format
- WP_Query using meta_query with relation OR and orderby meta_value doesn’t work
- Using custom meta_query with relation not working as expected
- Identify which loop you are hooking into; primary or secondary?
- WP_Query ordered by custom field that is a date string?
- querying with custom meta field with meta_query
- Order by two meta keys
- multiple meta key but get server load is very high