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
- WP_Query not using relation key as expected and not producing any results
- Meta query with ACF relationship field
- WP_Query() show posts that end later than today
- 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
- Query by 2 values of a repeater ACF field
- Filter posts with meta_query NOT IN where value has multiple values
- 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
- Integrate Custom Post Type Events into Calendar
- How to get specific post meta by title or id
- How to inherit field value from parent post into in child / sub post
- find custom post type post by searching its custom field with my string
- WP_Query of custom post type sorted by meta_key has unexpected results
- posttype and custom fields on multisite
- 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?
- How do I list a custom field and custom taxonomies for each result in a loop?
- order the meta query results by 2 custom fields
- ACF – Retrieve custom taxonomy from a relationship field
- Alike Shortcode using in Custom Shortcode
- Sort custom posts by date and then by taxonomy
- Query custom post type that has a serialized relational advanced custom field value
- Sort custom post column by generated value?
- build child and anchestor three from post parent
- Unable to gather Image URL from Custom Post Type’s; Custom Meta Field
- meta query condition don’t work
- How can I query and sort custom-post type using WP_Query
- Custom query result empty on page 2
- Meta query and compare “!=” not working as expected
- 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
- Filter custom WP_Query by first letter of a custom field – hopefully using Search and Filter Pro?
- sorting in wp query based on custom field value
- Linking posts together with Advanced Custom Fields “both ways”
- Not able to get my custom search result using meta_query and tax_query together?
- Custom Field as Custom Post type element class
- WordPress query in which condition uses custom field
- WordPress loop add heading before first of type
- How to make a shortcode for my WP_Query Loop? [duplicate]
- Error in WP Query. If variable is empty it is displaying previous post value
- 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
- Custom Query With Multiple Meta Key Value
- Storing/querying custom date data
- Custom Post-type not returning the right child_of
- Get Posts ordered by a date custom meta field
- querying to custom field over ACF REST API
- 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
- WordPress custom field sorting, weird behavior: the latest post is at the end
- WP Query filtering by custom category not showing all relevant posts