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
- Problem making a WPQuery with ACF boolean
- Meta_query compare operator explanation
- meta_query with meta values as serialize arrays
- Nested meta_query with multiple relation keys
- meta_query ‘compare’ => ‘IN’ not working
- Use REGEXP in WP_Query meta_query key
- WP Query Args – Title or Meta Value
- WP_Query orderby date not working
- Meta query with string starting like pattern
- compare meta_query in get_posts arguments
- How to query posts based on lat-lng coordinate as post meta?
- how to show posts that are missing a meta_value
- Set Alias for meta_query arguments in get_posts()
- Sorting: custom query with orderby meta_value_num THEN by title
- Display List Of Posts Containing a Relationship Field Value [ACF]
- Display products from specific category in shop page
- WP_Query() show posts that end later than today
- Using OR conditions in meta_query for query_posts argument
- How to Compare Two Meta Fields
- Changing the meta_query of the main query based on custom query_vars and using pre_get_posts
- Does tax_query really beats meta_query in all situations?
- WP_Query with checkbox meta_query
- Add indexing to meta_value in wp_postmeta
- Get Recent Posts by Date in Multisite
- Is it possible to orderby multiple meta_keys when using meta_value_num?
- Custom WP_Query order by post_meta and (author) user_meta
- Query WooCommerce orders where meta data does not exist
- Filtering a WP_Query meta_query by numeric values isn’t working
- Getting attachments by meta value
- Query Multiple Post types each with own meta query
- Execute a large WP_Query with many “AND” Meta_Queries?
- WordPress Custom Query to show posts from last x years
- Query all posts where meta value is empty
- WP_Query min and max values
- WP_Query using meta_query with relation OR and orderby meta_value doesn’t work
- Using custom meta_query with relation not working as expected
- Perform query with meta_value date
- querying with custom meta field with meta_query
- Order by two meta keys
- multiple meta key but get server load is very high
- Meta Query with date and time on the same Day before given time
- A WP_Query that will look for posts after 2 weeks ago OR with a certain meta value
- How to grab metabox value in wp_query meta_query key
- WP_Query meta_query where meta value ends in space
- Order by meta_value_num DESC and meta_value ASC on WP 4.0
- Finding all results from database within 500 miles of the given latitude and longitude [closed]
- Nested query inside Logical operator OR not working in meta_query
- Is “orderby” in WP Meta Query conflicting with Meta Query?
- WordPress meta_query and order by custom field
- Query by meta_key and order by meta_value_num return orderby date
- What is an efficient way to query based on post_meta?
- WP_Query not working as expected for attachments and custom meta_query
- datetime picker, timestamps and meta queries
- How do I create my own nested meta_query using posts_where / posts_join?
- WooCommerce: filter by parent product’s taxonomy and product variation’s meta data
- How to order a post type with meta_value_num and if meta_value_num does not exist then order by date
- Revolution Slider Orderby Two Custom Fields
- Compare two meta-fields in a wp_query (where meta-field-A is larger than meta-field-B)
- Wp_query order by multiple custom fields?
- How can I create a WP_Query that returns posts where one meta_value
- Meta Query querrying several post types based on ACF fields is broken after update to WP 4.1
- WordPress altering my custom query, How to fix it?
- WP Meta Query for some meta (array) values
- Exclude post on loop by multiple meta key value
- Sort users by meta_value_num
- Querying by taxonomy vs Querying by Custom fields Speed Comparison
- How can I hide posts that are over 2 years old
- query posts in functions.php and update a field
- pre_get_posts filter using numeric meta_query comparison (from dates)
- How to get sum of meta_values of a meta_key in wp_query according to conditions
- How to query ‘posts_per_page’ to display a different blog posts index template?