Support

Home Forums Event Espresso Premium Customize Upcoming Events Widget to show only today's events

Customize Upcoming Events Widget to show only today's events

Posted: July 31, 2015 at 12:37 pm


Eric Amundson

July 31, 2015 at 12:37 pm

Hi!
How would I customize the Upcoming Events Widget in EE4 to show upcoming and current (active) events from just today?

I think I see where in the widget to do it (line 318)

// if NOT expired then we want events that start today or in the future
				if ( ! $show_expired ) {
					$where['Datetime.DTT_EVT_end'] = array( '>=', current_time( 'mysql' ));
				}

I know how to do the custom plugin for the new widget, I just need a clue about how to change the code.

Thanks!
Anne


Josh

  • Support Staff

August 4, 2015 at 1:33 pm

Hi Anne,

The code you posted handles the functionality of the widget where someone can set it to display only upcoming events or also display expired events too. A PHP developer on your team should be able to help work in the additional code that also checks for whether the event starts today. One example could be:

$where['Datetime.DTT_EVT_start'] = array( '<', strtotime( 'tomorrow' ) );

Please note that the a lot of the code has been rewritten in Event Espresso 4.8 due to a necessary datetime refactor. The code you posted from the widget is included in the datetime refactor, so you’ll need to update your widget for 4.8.

The support post ‘Customize Upcoming Events Widget to show only today's events’ 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