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 should you use WP_Query vs query_posts() vs get_posts()?
- When to use WP_query(), query_posts() and pre_get_posts
- Can wp_query return posts meta in a single request?
- Meta query with string starting like pattern
- compare meta_query in get_posts arguments
- How to use the_posts_navigation for wp_query and get_posts?
- WP_Query vs get_posts
- How can I use order_by to order by two meta_keys without excluding posts that don’t have those keys initialized?
- meta_query: using BETWEEN with floats and/or casting to DECIMAL
- Get posts from Network (Multisite)
- How to order by post_status?
- Using get_posts vs. WP_Query
- Delete all posts from WordPress except latest X posts
- Function in array as arguments for WP_Query
- Sanitation needed for WP_Query or get_posts calls?
- Differences Between WP_Query() and get_posts() for Querying Posts?
- WP_Query to show post from a category OR custom field
- Get Recent Posts by Date in Multisite
- Sorting posts by custom date fields (non standard date format)
- get_posts with multiple categories
- get_template_part in for loop
- Use of caller_ get_ posts
- Getting attachments by meta value
- How-to exclude terms from the main query the most performant way?
- Is it possible to select against a post’s parent’s fields with WP_Query?
- Query all posts where meta value is empty
- meta_query where value is equal to given value
- Get posts by meta data OR title
- get_posts not finding argument: post_name
- querying with custom meta field with meta_query
- Meta Query with date and time on the same Day before given time
- Group posts by custom field
- Get posts with condition on comment meta value
- 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
- getting posts and number by specific meta value in multiple meta
- How to query using a combination of custom_field values?
- Sorting Posts by custom field
- Use post__in and post__not_in together?
- Order posts by date and then by custom field
- What should I use, get_posts or wp_query for less CPU load?
- Revolution Slider Orderby Two Custom Fields
- Different Results with query(‘s=computer’) vs get_posts(‘s=computer’)?
- How to get post from all Blog Multisite to the Main Site?
- Query two post types and order by two different date fields
- WordPress altering my custom query, How to fix it?
- Querying by taxonomy vs Querying by Custom fields Speed Comparison
- WP Query post meta value
- Get all posts without tags
- get_posts() seemingly ignoring post_type
- Can not switch the queried post in pre_get_posts hook
- Order by meta_key in custom post type doesn’t affect the query
- How to find out what “Blog pages show at most” is set to [duplicate]
- Count posts returned by get_posts in external PHP script
- Trying to check and see if a post has a featured image outside of the main loop
- How to show only one post for each categories of taxonomy of custom post that contains a specific custom field
- WP_query category__in not working, only pulls from first category
- meta_key and meta_value not working together
- How can i make WP_Query return post image and categories?
- Custom Field sort not working (WP 3.8.1)
- wp_query with multiple custom fields
- SELECT * FROM $wpdb->posts WHERE ID > 160
- How add a custom posttype name using ACF field to a query post array
- Filtering posts by custom field value not working
- Display link to taxonomy archive only if it has posts with certain custom field values
- getting posts and number by specific meta value in multiple meta
- Ordering Posts Type A by Custom Fields of related Post Type B
- Adding multiple post queries with parent and children to page – Best Way
- Order Posts by meta value AND published date
- How do you Query posts with nothing in common?
- WP_Query, tax_query and term_meta: How to?
- Get posts for last working week in WP_Query
- get_posts – get all posts by array of author
- Search Posts with Custom Fields as query
- wp_query add arguments using array_push if variable met
- Create a sitemap without a plugin – get parent pages only?
- Creating a custom search for a specific post type
- 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
- get_posts() not working with multiple statuses
- exclude posts with a specific custom field and value
- Return only post(s) which have post_excerpt
- Add quicklink to in the Admin posts page where I can query by a meta_key
- How to make Meta Query case sensitive?
- Return Taxonomy/Term Information with Posts (WP_Query/get_posts)
- How to Filter Posts by Custom Fields?
- Display custom field meta outside loop, site wide
- Help with WP_Query – Too many mySQL queries
- WP_Query() and get_posts() can’t handle over a thousand posts?
- Fetch Record based on meta key dates
- Meta_query with multiple keys and multiple values
- Orderby is working with one query but not with other