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?
- How to rename default posts-type Posts
- Posts to expire (deleted) after a date
- Custom Post Types Not acknowledged for date.php template
- What is the impact if i ignore title and content in my custom post types CPT?
- Shortcode doesn’t display in custom post type
- Linking to the most recent post in a Custom Post Type
- Custom Post Type permalink shows wrong page: homepage/index.php
- Changing custom type name hides the posts
- WordPress custom post type capabilities issue
- i cant see the max_num_pages of a custom wp query
- WP_Query with custom post type ID
- Timber plugin (Twig) does not show custom type posts in index page [closed]
- Custom Post Types – Taxonomy and Customization
- WordPress REST API V2: “{CUSTOM_POST_TYPE} matches Term ID List and Term ID Taxonomy Query, but should match only one.”
- How to change Elementor Template for Single Page Post on Load
- Create WordPress User in backend, and automatically create a new post in Custom Post Type with user uame as the Title in the post
- How to redirect custom post type posts to one url with htaccess?
- Search custom post type result in same template page
- How to have permalink structure based on taxonomy terms
- How to switch from custom post type URL to category URL?
- Unable to get the upcoming events for custom post
- Repeatable custom meta select boxes
- Getting (Invalid) when adding custom taxonomy of custom post type link in menu [closed]
- Display custom taxonomy posts of custom post types
- Custom Post type field don’t show in single machine
- Get X posts with the same terms as the current post (custom post type and custom taxonomy)