Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support masoodak

    (@masoodak)

    Hi @ldkeast,

    Thanks for reaching out!

    The query needs to be tweaked a bit, and instead of ordering by date, events need to be ordered by event_date along with a meta query comparing today’s date with event dates. Kindly try replacing the args array in the snippet you mentioned with the following,

    $args = [
    		'post_type' => [ 'tribe_events' ],
    		'orderby'   => 'event_date',
    		'order'     => 'DESC',
    		'meta_query' =>[
    			[
    				'key'     => '_EventEndDate',
    				'value'   => date( 'Y-m-d H:i:' ),
    				'compare' => '<=',
    				'type'    => 'DATETIME',
    			],
    		]
    	];

    The shortcode should now return past events instead of upcoming ones.

    Let me know if this helps.

    Kind regards,
    Masood

    Thread Starter ldkeast

    (@ldkeast)

    I added a second shortcode with your change at the top of https://keastandassociates.com/testing/filterable-blog-tests/
    and you can see this doesn’t solve my problem. We want to display ALL DATES, not just future or just past.

    What do you suggest?

    Plugin Support Abz

    (@abzlevelup)

    Hi @ldkeast, this would need more customization on your end. You can take a look at our REST API → https://theeventscalendar.com/knowledgebase/k/introduction-to-the-events-calendar-rest-api/.

    Let me know if that helps.

    Best,
    Abz

    Plugin Support Abz

    (@abzlevelup)

    This thread has been inactive for a while, so we’ll go ahead and mark it Resolved. Please feel free to open a new thread if any other questions come up, and we’d be happy to help.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Problem displaying past events past 6.0.1.1 (example provided)’ is closed to new replies.