Just for your Info.
I switched my Plugin to Advanced Custom Fields and created the Query like this. Maybe it was because of the “-” I used in my CustomField or it was the format of my Date.
$today = date('Ymd');
$args=array(
'post_type' => 'veranstaltungen',
'posts_per_page' => 3,
'meta_query' => array(
array(
'key' => 'ende',
'compare' => '>=',
'value' => $today,
),
),
'meta_key' => 'start',
'orderby' => 'meta_value',
'order' => 'ASC',
);
$loop = new WP_Query($args);
?>
<?php while ( $loop->have_posts() ) : $loop->the_post();
Thanks to everyone trying to help! 🙂
Related Posts:
- WP_Query vs get_posts
- get custom post type by tag
- Order posts by ID in the given order
- How-to exclude terms from the main query the most performant way?
- Pagination with WP_Query is buggy – working for some pages, but not the others
- Get the number of posts from the current page results
- How to place a loop within another loop?
- Pagination/infinite scroll with WP_Query and multiple loops
- Ajax Infinite Scroll In Custom WP_Query Loop Not Working
- How to change a custom query into a standard loop?
- Transient pagination not working properly
- Injecting content with $wp_query->current_post restarts from zero on paged pages. How to inject content after X posts, regardless of pagination?
- Woocommerce custom loop to show all the products [closed]
- wordpress query in header won’t reset and corrupts other loops
- Paginated HTML Sitemap
- Why does the_content not work like others for a set post id?
- 2 loops on page – one with orderby rand second orderby date
- Undefined WP_Query::has_posts()?
- Create ONE callback for all page templates, post filter queries + paginated pages, triggering pagination via AJAX
- Pagination is broken and I need help fixing it
- How to use WP_Query to display many posts?
- Counter problem, infinite loop when post_per_page equals X
- Five posts from a category in footer
- Loop returning only 1 result
- How to get all unique categories for posts in loop?
- Using the_post_thumbnail resets current loop item ID
- Order by empty custom field
- Excluding pages in WP_query using ACF
- reset to main loop doesnt work
- Post loop for all taxonomy terms
- Stuck in the query loop
- New WP_Query loop in admin causes problems
- Need to convert string of term ids into comma separated integers for use in an arguments array
- How to remove the most recent post from $the_query
- How do I get my custom query to work with search results after the first page?
- Issue with front page navigation after upgrading to 3.4
- Include current post into loop
- How to display the featured image for each post?
- Check for the main query from the template
- Exclude recently updated post from custom WP_Query using multiple loops
- get_posts output always same post
- How to use WP_Query() on single.php?
- difference between querying database and using the loop
- Stomping WP_Query in author archive to facilitate pagination with custom queries
- How to make posts unqueryable/unpublish posts where ACF relationship field is an unpublished post? [closed]
- Loop increase in while loop not working
- posts archive page – closing WP_Query loop correctly [closed]
- AJAX Breaking Offset Argument In WP Query
- Continue or break the while loop
- Loop posts based on permalink term
- Save (and exclude) posts from loop to use in another loop on page
- Get all posts with empty meta_value
- Loop 3 posts column wise and continue the loop into same columns
- Check if a post has term inside loop
- How to Order By Two Custom Fields?
- Display specific page (that is child) content on parent page
- Does putting queries within loops cause an issue on WordPress?
- Query Taxonomy By Page Title
- Function using get_posts() with tax_query not working when called from functions.php
- How to change the default post type over the loop?
- Query Not working as expected
- Determine if ID is page or post and query the ID
- How to make the ‘request’ filter work?
- get_children() Archive Template
- Populate select list with meta values from all posts of a Custom Post Type
- show most viewed post
- How do I stop the same post showing multiple times in a archive?
- Bootstrap grid while loop
- how to get custom attachment url?
- Display posts side by side with custom query
- WP_Query & Duplicate entries
- WordPress For Loop Prints Unwanted Extra Paragraph Element
- Calling a function with WP_Query only ever brings the first result
- query_posts() doesn’t seem to be called in my page
- Some doubts about how the main query and the custom query works in this custom theme?
- Pagination returns 404 after page 20
- Ordering Posts by parent category, name ascending
- WP_Query a custom field value bringing back 0 results
- Set Transient on CPT
- Iterate through ID’s in loop
- Load 3 posts in flexslider slide [closed]
- Loop through multiple custom fields with increasing number
- Different number of posts showing in development vs production server
- Issue with WP_Query (need a array of selected ID’s)
- An archive page without post format (just standard post)
- Multiple wp_query loops showing first 5 posts on all pages instead of older posts[Resolved]
- How to exclude posts ordered by comment_count from subsequent wordpress loops using WP_Query?
- meta_query dates from an array
- Creating array to compare custom field values
- Multiple loop for “featured” items returns wrong posts
- $query conflicting with other queries in the same page
- Pagination in custom query not working [duplicate]
- WordPress Post Looping? [duplicate]
- Remove 5 latest posts from the loop
- Exclude post formats in custom loop
- How to write a query-function as a query-shortcode?
- Show linked products using wp query and woocommerce
- Standard Loop – wp_query
- Custom Wp_query loop takes very long
- Show number of posts AND number on current page (cannot make it work)