Try an array of arrays in your meta query.
$args = Array(
'post_type' => 'event',
'posts_per_page' => -1,
'meta_key' => 'event_date',
'orderby' => 'meta_value_num',
'order' => 'ASC',
'meta_query' => array(
array(
'key' => 'event_date',
'compare' => '>=',
'value' => intval(strtotime(date('Y-m-d'))),
'type' => 'numeric'
)
),
);
$query = new WP_Query( $args );
Related Posts:
- Query based on custom fields start and end date
- WP_Query orderby custom field then post_date in one query
- Comparing timestamps in meta query doesn’t work
- Display two post types ordered by two custom fields
- Display posts if a custom field value is equal to another custom field value
- Filtering by Post Meta Custom Fields – Performance
- Custom Post type and Custom Field WP_Query
- WP_Query: include custom post type only with specific meta value
- Returning a list of custom post types excluding those without a specific meta_value
- Two near-identical custom field types – one works, the other doesn’t . What can cause this?
- wp_query check if integer exists in custom field’s array
- WP_Query order by custom field, then randomly order some of results
- Query custom post type with ACF Date
- Stuck in Order by more then one
- Meta Query Not Returning Output Despite Having Matching Values
- Order Custom Post Type by Custom Field Value
- Possible to filter custom post type with multiple meta data?
- Getting a custom post’s custom field based on another custom post’s custom field select
- Group by custom field value (start and end times)
- Using WP meta query to show custom post types by a start and finish date
- Create if else for post types in WP_Query ‘post__in’ values
- Filter posts by their related field’s custom field
- meta query multiple values for the same key
- Sort custom post archives by a meta value from a different custom post type?
- Custom post types – meta_query: search lesson which starts sooner
- Meta_Query refuses to return results
- Query events post type after current date and timezone
- Selecting posts older than the current Unix epoch timestamp
- Querying meta values within an array
- Custom Post Type + Custom Meta Query Not Showing 2012 Posts
- Display ACF object field data using Elementor Custom Query
- Search multiple custom fields by using meta_query
- Sorting a query by custom field date
- Automatically fill custom field value on post publish/update
- How to sort CPT by custom meta value (date), and return posts month by month
- Use Custom Post Type as Custom Field
- WP_Query on custom post type not displaying, multiple loops & get_template_part
- Filter posts with meta_query NOT IN where value has multiple values
- Get Custom Field Values by Another Custom Field in WordPress
- How to Display ACF Relationship Custom Field as Link to Specific Custom Post?
- wp_query to find posts by year and month
- meta_query compare >= not working but
- Including Custom Meta with posts_where query
- Filtering custom post type on a combination of custom taxonomies and custom fields?
- How can I get the number of custom post type posts that have a specific attachment image set?
- Bulk Update Custom Fields for Custom Post Types
- Orderby CPT custom fields not working
- Troubles with acf/save_post and WP_Query
- Including metaboxes from custom post types in global search — continued
- Using advanced custom fields from one custom post type in another custom post type / using nested shortcodes
- Query Custom Post Type Taxonomy term with multiple parameters
- Custom fields (wp_post_meta) vs Custom Table for large amount of data
- How to Output which matched meta_keys were found from custom_type_posts?
- WebP Fallback for Inline Background Image in Style Attribute
- Why is my WP Query not returning first result’s post meta?
- WP Query ‘posts_per_page’
- How to get specific post meta by title or id
- Having Issue on Ordering CPT by Custom Field In Custom WP Query
- WP_Query of custom post type sorted by meta_key has unexpected results
- Custom Query: If One Post Object Field Value Is The Same As Another
- How do I replace the post title with a custom field?
- Sum and count of custom field values
- Create a WP_Query where if the first value of the first row is equal to the second compare other value
- Sorting by meta_key different to search criteria?
- Cache issue with WP_Query and custom field filtering
- Alike Shortcode using in Custom Shortcode
- Sort custom post column by generated value?
- Unable to gather Image URL from Custom Post Type’s; Custom Meta Field
- Query posts by current ACF meta key value on single page as related posts
- meta query condition don’t work
- Use WP_query to match post types based on custom field values
- How to access repeater field of a custom field?
- Custom meta fields not showing up in WP_Response Object via custom endpoint
- Query a Custom Post Type using SELECT that has ACF fields to compare dates
- Wrapping an unknown amount of posts inside separate HTML Containers during WP_Query loop
- Post Filtered by Custom Field Value
- Show specific posts with WP_Query using ACF Post object
- Filter custom WP_Query by first letter of a custom field – hopefully using Search and Filter Pro?
- Autofill advanced custom field with user data
- Advanced search form with multiple custom fields
- sorting in wp query based on custom field value
- WordPress loop add heading before first of type
- How to make a shortcode for my WP_Query Loop? [duplicate]
- Conditional posts in WP_query for search
- Can’t pick up a field created with Advanced Custom Fields
- How to stop wp_query searching pages as well as the specified CPT
- How to query posts by meta keys AND under specific category?
- Unable to get the upcoming events for custom post
- Setting a custom $query->query_vars[‘meta_key’] breaks the WordPress menu
- WP_Query and two custom fields returns no posts
- Storing/querying custom date data
- Custom Post-type not returning the right child_of
- Show Posts in Vertical Tabs with Scrollbar
- ACF – Query relationship without ID
- How to show all posts of specific custom post type with their custom fields values?
- querying to custom field over ACF REST API
- WP_Query() displaying past post / event
- WP Query Conditionally query meta and taxonomy
- Post object GUID adding http:/
- Query order by a numeric ACF field