Do the other post have to be set to draft? Or would just showing today’s post work? If just showing today’s post works you could do something like the following
$today = getdate();
$args = array(
'category_name' => 'event',
'posts_per_page' => 5,
'year' => $today["year"],
'monthnum' => $today["mon"],
'day' => $today["mday"]
);
query_posts( $args );
Related Posts:
- Custom Post Type Archives by Year & Month?
- Set post date before 1970
- How to order posts of a custom post type by date DESC in dashboard Admin?
- WP_Query() show posts that end later than today
- Automatically fill custom field value on post publish/update
- Uploading DB to server from local is not matching the post dates
- Permalinks using event date (year & month) instead of publication date
- How to sort CPT by custom meta value (date), and return posts month by month
- Date query for a custom meta field
- wp_update_post on specific custom post type
- Custom Post Types – How to include custom fields
- How to make an archive page displaying posts in a date range
- Query current and future events, ordered by begin date
- Displaying custom posts only if custom meta box’s date is not expired
- Get the next event using date_query
- wp_update_post based function works on existing posts, but not new posts
- get_queried_object error How to show post count by month in the taxonomy page
- Updating post title using wp_update_post
- Custom Post Type Events Archive Grouped By Month
- query_posts with a custom post type, a meta_query and sorting by post date?
- How Can I Set the Post Author of a Post I Just Created With PHP?
- Insert and then update post_type by wp_update_post
- Posts are duplicating on wp_post_update
- Default sort on admin columns with meta date hides draft posts with empty date value
- WP_Query most viewed posts, in multiple Post Types, last 30 days, excluding a specific taxonomy term
- Post count by month of taxonmy term
- Meta Query posts not showing on ending date of custom field
- Use the same date-based permalink structure for all post types
- Post author for revision not being set on update/insert
- How to order posts of a custom post type by date DESC in dashboard Admin?
- Order post by date with ACF
- How to automatic update date and time when save custom post type
- Programmatically change post visibility on save_post action return a 500
- Why does wp_update_post causes white screen?
- Update post if exist from PHP
- Sort custom post type by most current date picker
- I am trying to get cutom post cout by month of current taxonmy term
- Odd behaviour for the update button when displaying a WP_List_Table
- How to display a WordPress Custom Field only on a specific day of the week?
- WordPress giving a 404 page when passing a year argument different than the current year
- Using WP meta query to show custom post types by a start and finish date
- Why does my URL keep returning 404 error code?
- How to keep a record of changes to a custom field?
- Problem with date comparison for custom fields
- Using global $post; with custom post types
- How to sort WP_Query by a custom text field (written as a date dd/mm/yyyy)
- How to set post date in post_type so that it’s same as latest post in category
- Display post count for a specific month
- Updating a custom post status after an expiry date rather than trashing it
- Compare ACF Date field to today or yesterday
- get_queried_object not work in taxonomy page
- Change the term based on the value of a $variable using wp_update_post in submitting a form
- update flamingo_inbound post type after insert
- save_post affect creation and deletion
- Want to display my custom date archive to date.php but dont know how
- Can I override the permalink/slug on creation
- Pre_get_posts comparison with custom field doesn’t work
- Display year value before a set of posts
- Custom Post save causes 500 error
- date archive future posts
- Get month and day from a Date Picker custom field
- Loop posts in a table ordered by a custom field value
- group posts by month/date ignore years
- How to get past and upcoming post by defining date in custom field?
- How to display custom post type ordered by a custom field date
- How to save an integer as taxonomy term?
- Generate daily archive whenever any post type is added
- Create a list of months based posts
- How to randomize published date for WordPress custom post type
- ACF Field to set Publish Date – Post Duplication upon Update
- Is it possible to specify a time interval (from, to) in ACF with date picker, or other custom field?
- Order Wp Query by earliest of 3 dates meta query
- WP_Query() displaying past post / event
- How to display *block number* instead *date value* on WordPress posts?
- Many CPT is conflicting of the custom date
- ACF – Updating all posts of CPT when a custom field from options page is updated
- Setting Post Title via Meta Data returns Auto-draft
- Tags not working in my custom post type
- Custom post-type metabox position
- wp_trash_post action hook with custom post type
- Not sure why this template for custom post type posts isn’t displaying anything. What’s missing?
- What’s an efficient way to change the post status of many posts at once?
- Use Pages for Custom Post Type
- Return the name of the post type
- I can’t access custom taxonomy page listing
- Is it possible to load a different sidebar in single.php based on a meta_query filter?
- How to have permalink like domain.com/term/postname?
- List Posts By Custom Taxonomy
- Can variables be used to rewrite a Custom Post Type permalink? [duplicate]
- Creating two loops based on different logic
- How to Echo Metadata Value in Currency Format
- Issue on Working with Metabox – Checkbox to enable Sale Items
- Filter posts by tax (dropdown) and meta value
- How do I amend form data before it is saved for a custom post type
- Archive-posttype.php isn’t loaded
- List of all entries of custom-post-type: Add year-parameter?
- Wp Query with multiple custom tag(taxonomy) by get the terms
- Custom Posts values in custom post overview
- Should I use custom taxonomies or not?
- delete_post_meta() for whole CPT / multiple posts?