Support

Home Forums Event Espresso Premium how to hide just the time on upcoming events widget

how to hide just the time on upcoming events widget

Posted: October 17, 2016 at 11:35 am

Viewing 1 reply thread


Nancy

October 17, 2016 at 11:35 am

Is there any way to hide just the time on the upcoming events widget.

I found this in another post which hides both the date and time.
ul.ee-upcoming-events-widget-ul .ee-event-datetimes-li
{height: 1.5em;
overflow: hidden;
}

However I would like to show the date. The css above hides the date and time when not showing the date range. But does not hide either when showing the date range.

I would prefer to show the date range without showing the time. Is this possible?

If not, is it possible to just hide the time when not showing the date range?


Lorenzo Orlando Caum

  • Support Staff

October 19, 2016 at 9:47 am

Hello,

That can be done by creating a custom upcoming events widget. See this support post:

https://eventespresso.com/topic/attempting-to-customize-upcoming-events-widget-no-widget-php-available/#post-102681

Next, it is uses espresso_list_of_event_dates or espresso_event_date_range.

From your feedback you are using the date range option which is espresso_event_date_range. Since you only want this change for the upcoming events widget, then you’ll want to move a copy of that function site specific plugin (https://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/) or your child themes functions.php file.

Then change the name so its unique:

espresso_event_date_range –> custom_espresso_event_date_range

Now you can customize the custom function to show the date and time format how you would want. Here is an example: https://gist.github.com/joshfeck/143e808c38d9ac82a658

Once that is set, then you’ll go back to your custom upcoming events widget and change the espresso_event_date_range to your custom function name.

Afterwards, the custom widget will use your custom function and it can be added through Appearance –> Widgets in your WordPress dashboard (WP-admin) and you can remove the default upcoming events widget.


Lorenzo

Viewing 1 reply thread

The support post ‘how to hide just the time on upcoming events widget’ 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