I think you have error in your query. Please try this:
$posts = get_posts(array(
'post_type' => 'events',
'posts_per_page' => -1,
'meta_query' => array(
'meta_key' => 'from_datetime',
'type' => 'DATETIME', // You can also try changing it to TIME or DATE if it doesn't work
'meta_value' => date( "F d, Y g:i a" ),
'meta_compare' => '>',
),
'orderby' => 'meta_value',
'order' => 'ASC'
));
Related Posts:
- Get posts for which a custom field is not present, with get_posts
- get_posts custom field
- Using get_posts to get posts based on a checkbox value with Advanced Custom Fields
- Posts query according to meta box date
- Mathematical operations on custom field values? (updated)
- When to use WP_query(), query_posts() and pre_get_posts
- Meta query with string starting like pattern
- compare meta_query in get_posts arguments
- meta_query: using BETWEEN with floats and/or casting to DECIMAL
- Get Recent Posts by Date in Multisite
- Query all posts where meta value is empty
- meta_query where value is equal to given value
- querying with custom meta field with meta_query
- Order by meta_value_num DESC and meta_value ASC on WP 4.0
- Function to check if author has posted within the last x days
- WordPress altering my custom query, How to fix it?
- WP Query post meta value
- Order by meta_key in custom post type doesn’t affect the query
- How to show only one post for each categories of taxonomy of custom post that contains a specific custom field
- wp_query with multiple custom fields
- Filtering posts by custom field value not working
- getting posts and number by specific meta value in multiple meta
- Order Posts by meta value AND published date
- wp_query add arguments using array_push if variable met
- Create a sitemap without a plugin – get parent pages only?
- Group WP_Query by meta_key date
- get_posts – find out if querystring was crap and fallback is used
- How To Fix WP Query Returns Results But Shouldn’t?
- Output an array of terms for a ‘tax_query’ => array()
- Creating query to show which editor (classic or block) was last used to edit a post/page
- Return Taxonomy/Term Information with Posts (WP_Query/get_posts)
- Display custom field meta outside loop, site wide
- Orderby is working with one query but not with other
- add active class based on permalink and url
- Weird orderby => post__in issue
- Extend product search with meta in WooCommerce
- how to make members list directory through wordpress post custom meta key.
- Adding multiple meta_key fields as orderby options to a WP Query via a function
- meta_value_num not ordering all items
- Conflict with get_posts and the_content
- WP Group posts by year(desc) > month(desc) > date(asc)
- How to show more post at a given category?
- Get posts by list of post IDs ordered by those IDs?
- Reset WordPress Post Query to default
- Best choice for multiple loop in page?
- wp_query get data from advanced custom field in wordpress
- meta_query: check if number exists
- WP_Query Meta_key is text value and need to sort as numeric not working
- filter wp_query result with custom field values
- Order post type by sum of two custom fields
- Use WP_Query or query_posts() or get_posts() for optimizing a site?
- “paged” in WP_Query returns 0 posts
- Specify strict ‘order by’ in WordPress query
- How I can change the condition or compare operator for WP_Query in pre_get_posts
- Check if searched number is within the post meta value
- WP ForLoop to compare meta information of posts to determine what post to display
- Retrieve select tag custom values from array and display them in current page with wp_query?
- How to use a dropdown to filter posts by custom field
- WP_User_Query and user posts
- Order WP_Query results by meta key value in custom query
- add_query_arg to compare and display events from a certain date
- Why always one post missing
- Query multiple post types, but different order for each
- How to add date_query to meta_query array
- Order by the first array within a meta_query
- Why my query is not “Main_query”?
- Query ACF relationship field – Comparator IN – Value array
- How to _GET multiple value checkbox WP_Query in Custom Toxonomy / Custom Fields
- Facing problem with tax_query results
- How do i create a custom post query when the meta value is an array?
- How to add a “base” filter for all posts visible to visitors on the site?
- WP Query – grouping posts by same meta key, adding together values from another key
- Retrieve all custom field values of a specific custom field metakey as an array, inside WP_Query
- meta_query is overriding default search
- Comparing Meta Field date in WPQuery using Meta_Query?
- Order 2 meta_queries differently in WP_Query?
- using custom meta user data to run queries in WordPress
- Order posts by title and custom field value?
- How to create URL parameters to run custom queries?
- get_posts query caching?
- Get posts with any value in attribute
- List users by Year of Birth using a foreach loop to dynamically populate years and data
- Slow query when selecting with large meta query or post__in
- Meta key in wp_query bug?
- Custom WP_query and integrating into theme file
- Sorting posts by meta values: 2 different orders
- Sorting Posts with meta value not working
- Order by three custom fields (Y-m-d), then separate into yearly sections
- Both WP_Query and get_posts returning 1 post
- Loop through multiple custom fields with increasing number
- new WP_query using custom fields
- query post based on comparison
- Weird query with get_posts and WP_Query
- orderby and order filter in get_posts or WP_query function in wordpress not working
- tax_query not working properly with get_posts
- Query custom post types by meta field in a term from custom taxonomy
- How to retrieve _embed (etc) fields in get_posts custom query?
- Best performance for use Custom Field in WP
- How to include custom fields in wordpress search
- Extend search query to search meta keys values based on search string