I have an events custom post type in wp 3.1 I am using the following query_posts:
<?php query_posts('post_type=event&meta_key=event_date&orderby=meta_value&order=ASC'); ?>
As you can see I am ordering by the custom post type date. My issue is that I want to list only the events for the current month. Query posts offers monthnum but then I need to pass the monthnum into the query and I have no idea how that would even be possible. The date format is YYYY-mm-dd
If we were to get the date of the publication of the post it would be something like:
But to get the date from the meta values, have you tried?:
You can get the first day of the current month with something like:
Otherwise, I would try by retrieving all the posts as you were doing and then make date objects with each meta value and compare its month and year with current.