What is missing? One tiny detail… And it’s easy to overlook…
the_field('datum_event');
Prints the field using the format you’ve defined in field settings. But… It has nothing to do with how the value of that field is stored in DB. ACF uses YYYYMMDD format when storing date values in DB. And WP_Query doesn’t use field format, since it looks directly in DB.
So you have to use other/raw format in your WP_Query:
$args = array(
'post_type' => 'agenda',
'meta_query' => array(
array(
'key' => 'datum_event',
'value' => '20190106',
'compare' => '>='
)
),
);
$loop = new WP_Query( $args );
Related Posts:
- WP_Query filtering in ACF field containing dates
- ACF Relationship Field Search Filtering [closed]
- ACF datepicker meta_query Compare Dates in m/d/Y g:i a – Not in Ymd Format
- meta_query with array as value
- Use meta_query to display events by date in custom field
- How to show recent and upcoming birthdays using meta_query
- Meta Query for specific months
- If two first numbers exist in wp_meta_query value
- ACF Date Based wp_query
- Custom query based on meta key – Reduce three states to two in results?
- What is the random string I am seeing when I use get_query_var?
- Any number in meta key (wp query)
- WP_Query with meta_query dosen’t return results
- Custom query filter by ACF date custom field
- Show single posts date, in a page of posts
- Using WP meta query to show custom post types by a start and finish date
- Order WP_Query by meta_key priority when ‘OR’ relation used for multiple meta values
- ACF: How to query for a given value count of an array like field? (e.g.: How many rows has a `flexible_content` field?)
- Comparing Meta Field date in WPQuery using Meta_Query?
- WP_Query, ACF field and array
- Pre get posts sort by meta key returns no results if meta key does not exist
- Slow wp_posts and wp_postmeta query using Advance Custom Fields
- Get posts meta_query by repater field
- How can I modify standard search query to include also ACF custom fields values?
- The sorting of posts by a meta_query with two keys fails while separated as single queries it works
- Get posts using multiple values from ACF checkbox as meta query wordpress
- How do I subquery with custom meta fields?
- Use value from meta key array for use in WP_Query
- How to use meta_query to retrieve posts from multiple custom post type
- WP Query Args – Title or Meta Value
- Does tax_query really beats meta_query in all situations?
- Query WooCommerce orders where meta data does not exist
- Execute a large WP_Query with many “AND” Meta_Queries?
- Query all posts where meta value is empty
- WP_Query min and max values
- Finding all results from database within 500 miles of the given latitude and longitude [closed]
- Revolution Slider Orderby Two Custom Fields
- query posts in functions.php and update a field
- Meta-value query
- Meta query field order together with post_date order causes posts without the meta field to be unordered
- pre_get_posts filter meta_query without conflicting existing meta_query
- Undefined property: WP_Query::$post
- Programmatically set ‘meta_query’ for filter
- Minimising Database Queries when using Advanced Custom Fields
- WP_Query on custom field and order results
- Comparing dates in custom field
- Tax query clause inside a meta query clause?
- Include custom field in Ajax search WordPress
- Orderby ASC changes to DESC in WP_Query
- Optional Meta Query
- How do I make a meta_query OR relation work? [closed]
- Elementor custom Query with ACF fields to show matching woocommerce products custom fields
- Meta_query on same meta key, with diffrenct values
- Can we return all category (not post) with Custom Query Filter? [closed]
- Extend product search with meta in WooCommerce
- how to make members list directory through wordpress post custom meta key.
- Taxonomy and Date in same query?
- date_query seems to be ignored by wp_query
- Query based on custom fields start and end date
- Query posts with “non set” meta value
- Ordering a mysql style datetime stamp with meta_query
- WP User Query with Custom Fields and Search Results
- Wp_query with 2 meta keys and array of meta values
- meta_query: check if number exists
- Event with multiple dates, display events chronologically
- WP Query / Meta Query [duplicate]
- Query posts by searching for a string in a meta field
- Added Date Filter To Popular Posts Query
- 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
- Query ACF relationship field – Comparator IN – Value array
- Combine query in WP_User_Query()
- Nearby locations using Advanced custom fields, maps?
- Multiple nested meta queries
- How to _GET multiple value checkbox WP_Query in Custom Toxonomy / Custom Fields
- How can I modify the query by adding to the existing query?
- create custom shortcode wp and put php code in
- WordPress Query custom ordering by temporary variable
- How to get only present and past posts with post_date
- How to create better WP_Query to look for date time which is anywhere between two meta values?
- Filtering WP_Query based on wp_postmeta keys values
- Multiple meta_query not working
- compare for multiple meta values for same key in wp_query
- datetime picker, timestamps and meta queries
- WP_Query with meta_query won’t orderby
- meta_query only check if both value are set
- Wrap group of wp query posts to parent div by date/year
- Extending WP Query: Custom geolocation meta values work, but tax_query breaks
- Using custom field as ‘orderby’ value causing post grouping by publish date
- Wrote a WP Cron Plugin and it triggers a fatal error upon activation
- Get the type of an advanced custom field (ACF) in a WP_Query loop [closed]
- Looking for a way to exclude frontpage and nav menu from query filter
- Creating Custom Query
- Get posts by meta value except one post [closed]
- WP_Query by meta key not returning any posts
- WordPress extremely slow when using get_posts with multiple meta_query relations
- I want to place a post before all others from an ACF boleen field
- WP_Query sort by ACF date field (newest first) with blank dates first
- Include custom post type that matches taxonomy field in another custom post type