Hi @debabratsharma,
You can modify the posts the widget display by hooking into tribe_get_list_widget_events and passing a different set of events. In this case past events.
add_filter( 'tribe_get_list_widget_events', 'past_events_list_widget' );
function past_events_list_widget ( ) {
$list_events = new WP_Query();
$list_events->query( array(
'post_type'=> 'tribe_events',
'eventDisplay' => 'past')
);
return $list_events->posts;
}
Hope that helps,
Nico
I’m looking for a widget to display PAST EVENTS next to my UPCOMING EVENTS, does anybody know of one or how can I modify the one I’m using to choose display?
I’m not a coder so anything outside of simple HTML will not help me.
Timo
Howdy Timo,
The easiest way would be to modify the code Nico shared to target only one widget. I don’t know of any solution closer to what you want than Nicos, so it’s an excellent starting point.
You might also be interested in voting on this feature request: https://tribe.uservoice.com/forums/195723-feature-ideas/suggestions/13101369-list-past-events
Cheers!
– Brook