Use get_posts function with WP_Query params instead of get_children. The code will than look like this:
$today = getdate();
$pages = get_posts( array(
'post_status' => array( 'publish', 'future' ),
'post_type' => 'event',
'sort_order' => 'ASC',
'orderby' => 'date',
'year' => $today["year"],
'monthnum' => $today["mon"],
'day' => $today["mday"]
) );
foreach ( $pages as $post ) {
setup_postdata($post);
?><h3><?php echo the_title(); ?> - <?php the_date(); ?></h3><?php
}
wp_reset_postdata();
Related Posts:
- How to Display a List of Users Who Have Made at Least 1 Post?
- Let private posts stay in status “private” after edit through “editors”
- featuring old articles without messing up with the archive
- Setting post meta data to random value during post status transition / on publish
- How to change post status from publish to draft using hook in wordpress?
- Hiding by default specific post status on backend list?
- Enable commenting on front-end preview page for pending posts
- Custom Post Status Posts viewable to the public
- How can a guest view the “Pending Review” Post?
- How do I batch create revisions of all posts?
- add filter to “quick edit menu” in wordpress admin
- ‘transition_post_status’ only fires when pressing “Add New”
- What differences are there between a Privately Published post and a Draft post?
- Update post status from “publish” to “trash” for half of posts
- How can I set a Post’s default visibility to private and pending review checked
- how to remove dash (-) post status from post title on posts listing page wordpress
- How to change post status from frontend?
- Posts and Attachments with “Published” status in Search
- Admin – create custom post status and display above table
- Restrict edit, but allow preview for custom post status
- WordPress capabilities on pending post status
- why there are so many posts whoes post_type is revision? will these records waste too much database space?
- $post->post_type not working
- how can i allow users to view their own pending posts in a front-end page
- Is there a way getting post fields using `transition_post_status`
- What function publishes a post when you click the publish button?
- Post Status Frontend Announcement
- Display amount of pending posts in back/front end
- Show Last Revision Of Post That Has A Published Status On Single Page
- How can I restore posts from ‘trash’ with their previous post_status? – WordPress
- How to set a Post’s default visibility to ‘Private’ in Gutenberg?
- Updating post status via rest api
- How publish post from pending status
- Hide or remove custom post status
- Put page on Archived statut after end of publication date
- get_next_post() not working with future post status
- Modify loop to include all post statuses not just ‘published’
- Function/filter or plugin to change post status based on custom field value
- get_posts includes “auto drafts”?
- I am creating a front end dashboard where I need to show all the posts by the current user. So, I need to show posts in publish
- Post Format Status [closed]
- Do anything on post_status change [duplicate]
- Get the Current Page Number
- Including categories in search results
- How to add editor’s name to entry meta byline?
- Use an attachment in multiple posts
- Pretty URL with add_query_var
- Using $wpdb to query posts with meta value containing current post_id
- Download external images if post is publish
- Forcing oembeds to top of post
- Can I change a post to a page by changing it’s type?
- Publish posts only after the condition is met
- Change existing label in the admin bar with something else
- Append a to every post to force additional page link (and static content)
- Limit function to specific post category
- How much of my site can I recover from public_html?
- How to get a list of all the years that have posts
- How do I use `posts_distinct` correctly?
- How to find what index page a post is on?
- Admin Posts Table Column Fitlering is not working for Custom Post Type
- WordPress REST API not returning all posts
- Get Meta Key Value While Saving Post
- Displaying Latest Posts on a Page
- How can i display gallery shortcode output under Post text
- Hiding Draft Post In Admin
- How to limit posts by category
- How to display posts via custom taxonomy terms using checkboxes?
- Retrieve only posts from a specific user in wp-admin/edit.php
- Adding an Archive button to posts page for administrators
- Security to delete post by Admin
- Is there a way to create a meta box that can be added multiple times to a post dynamically?
- What’s the safest way to switch and restore a post global?
- Filtering posts on Post Administration Page by Week Number instead of by Month
- Creating a WordPress Post via REST API – HTML or Markdown?
- Add two custom fields as a default to the “new post” page.
- Give posts a particular template based on the assigned category
- Post-Archive like a page in a specific subdirectory
- Get only X number of categories
- Conditionally exclude post from specific category on home page sidebar?
- Posts and Pages w. private visibility don’t show up in existing content
- How to create custom post page in WordPress?
- How do I display main query posts in random order using add_filter
- How do i bring out post category name in my widget?
- Passing values via an Ajax querystring
- Does having category name in permalinks affect SEO when having a post in multiple categories?
- Dynamically load posts based on category
- Set featured image on creating new post
- Get Categories & Posts With Type Article
- My post permalinks are always the same
- Multipage Post URL correction
- Set multi posts random categories and tags
- How can I set and update the the_date according to a custom field of the post
- how to create cron that post events daily in wordpress?
- Post not showing up sometimes on website
- Posts being replaced/deleted
- Update Post with Modified Data
- Help post permalink
- Wrap div-tag around posts in page
- Post data returning null [closed]
- Edit Page button is gone