Posted: March 11, 2021 at 9:56 am
i wanted to show the time on single event pages for multi-day events in a good way and i found this solution: https://eventespresso.com/topic/date-time-formatting-for-multi-day-events/ i added to the functions and thought “wow! works great!” later i found out that it erases the times and dates from the events list in the widget view… is there any solution for that? showing the multiday events with online one time still looks totally wrong: thank you! b |
|
Hi b, The solution for this is actually in the thread you linked to but I’ll go over it here. You can change the datetime output on the single event output by copying the Then change that copy to use Remove the above fix you used so the widget ca use that function again. If you don’t have a child theme already you can follow the steps here to create one: https://developer.wordpress.org/themes/advanced-topics/child-themes/ |
|
Thank you tony, I did the solution with copying the datetimes.php now. |
|
Did you remove the code you added above? When using the method I mentioned above, you don’t want to override the
If you still have it on the site. |
|
i removed it. i ONLY made the changes in the content-espresso_events-datetimes.php file. no changes in the functions.php. still the date-time in the widget shows up wrong (check the widget on the right side): https://www.benediktzeitner.de/ How can i show the correct time format there? |
|
My apologies but I guess I’m misunderstanding the problem here. The widget is showing the dates/times as it is expected to show them so can you add some more details on what is wrong? |
|
the widget is still showing weird times for multiday-events: “09.04.2021 – 11.04.2021 “from 6 to 5” does just not really look acceptable 🙂 How can I correct this? |
|
Ahh, ok, so that’s a totally different issue from your opening post then? That’s the default output for the widget, there is an option to switch it to use date range in the widget settings itself: Dashboard -> Widgets -> {sidebar} -> EE Upcoming Events -> Show Date Range. If that doesn’t work for you, may I as how else would you prefer the above to be output? |
|
not its not a different issue – i explained it in the title and in the first post of the threat. the new suggestions worked, thank you! however, it erases the little symbols for the date and the time from the widget. is it possible to still keep them? |
|
This is from your opening thread:
Which is a completely different issue to the default DateTime output from the widget not showing how you prefer, unless I’m misunderstanding something here?
You’re most welcome. Possible, yes, but you’re likely going to need your own version of the Upcoming Events widget which calls your own function to output the datetimes. The widget calls 1 of 2 functions from within EE, if ‘Show date range’ is set to yes, it calls It is possible to override those functions in a similar way to how you did above and then include whatever output you prefer in them, but it’s going to apply across the site and not just on the widget so I’m not sure if that will work for you? |
|
i just discovered another unfortunate effect of changing the content-espresso_events-datetimes.php: for single day events, the single event view doesnt show the end time anymore… how can i fix that? |
|
Hmm, yeah, so for a single event To fix that you’ll need to copy the espresso_event_date_range() function into your fuctions.php file and then right after this line:
Add something like:
Which will add the end time onto the end of that output when it’s a single date. You may need to move away from using the helper functions and create your own function to output the dates across all of the outputs in a way you prefer, but see if the above works for you first. |
|
The support post ‘show good time format in multi day events without messing up the widget view’ 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.