Support

Home Forums Event Espresso Premium Returning events in the past

Returning events in the past

Posted: August 25, 2019 at 4:43 am

Viewing 1 reply thread


neigd72

August 25, 2019 at 4:43 am

Hi,

I’m trying to create a page that lists events that have occurred in the past. I have this in the template php page:

$atts = array(
'title' => NULL,
'limit' => 10,
'css_class' => NULL,
'show_expired' => TRUE,
'month' => NULL,
'category_slug' => NULL,
'order_by' => 'start_date',
'sort' => 'DESC',
'meta_query' => array(
array(
'key' => 'start_date',
'value' => date('Y-m-d H:i:s'),
'compare' => '<=',
'type' => 'DATE'
)
)
);

// run the event query
global $wp_query;
$wp_query = new EventEspresso\core\domain\services\wp_queries\EventListQuery( $atts );

if ( have_posts() ) : ?>

...

It doesn’t seem to return any events though.

Any ideas? Thanks!


Lorenzo Orlando Caum

  • Support Staff

August 26, 2019 at 11:39 am

Hello,

Try this solution: https://eventespresso.com/topic/looking-for-a-shortcode-to-use-to-list-expired-events-only/#post-267961


Lorenzo

Viewing 1 reply thread

The support post ‘Returning events in the past’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso