Show upcoming events, Query by repetitive custom field
-
Hello, I created a custom post type called “events”.
An event can have multiple dates at which it will be held.
What I am trying to do, is show upcoming events.So I created a repeater custom_field for my custom post type, where I set multiple dates.
The problem is that if the first item in the repeater group is in the past, or if the first item in the repeater group is 3 months from now and the 2nd item in the repeater group is from this actual mount, my event wont be displayed at all, because only the first item gets queried :-/Here is my code:
$thisMonthSchedule = new WP_Query( array( 'post_type' => 'courses', 'posts_per_page' => 3, 'post_status' => 'publish', 'meta_key' => 'course-start-date', 'orderby' => 'meta_value', 'order' => 'DESC', 'meta_query' => array( array( 'key' => 'course-start-date', 'value' => date("d/m/Y"), 'compare' => '>=', 'type' => 'DATE' ) ) ) );
I kinda run out of solutions to try, so if someone can pin point me in the right direction I would be grateful ??
Thanks!
- The topic ‘Show upcoming events, Query by repetitive custom field’ is closed to new replies.