• Resolved traxtrack01

    (@traxtrack01)


    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!

    • This topic was modified 3 years, 8 months ago by traxtrack01.
Viewing 1 replies (of 1 total)
  • Plugin Support madalinaruzsa

    (@madalinaruzsa)

    Hi @traxtrack01,

    Thank you for your message!

    The repeater field are stored with 01, 02 at the end. Check the database inside wp_postmeta to see exactly the format. That’s probably why they don’t show.

    Kind regards,

Viewing 1 replies (of 1 total)
  • The topic ‘Show upcoming events, Query by repetitive custom field’ is closed to new replies.