Posted: August 15, 2014 at 8:16 am
|
So, I have been editing the display of the events widget and ran into a question or two. We host two different types of courses, most are two day events, and a few are one day events. Question is: I guess I’m just asking where the date format is pulled from and can I combine dates into a simpler format? Thanks EE3 |
|
Hi Chris, In the following file (which can be copied to the wp-content/uploads/espresso/templates to stop changes when the plugin is updated) is where all the widget code is found: /wp-content/plugins/event-espresso/templates/widget.php See this Pastebin for the code: http://pastebin.com/ux9LJ7S6
|
|
Dean, That worked like a charm. Now is there a way to get my single day events to display just the single day? Like an “If-Then” or something? The two day events look perfect but now a single day event displays like “November 27-27 2014” Beyond my limited coding skills at this point. |
Hi Chris, I think this is what you’re looking to do: start_date == $event->end_date) { // normal single day code to display the date goes here } else { // more than one day code to display the dates goes here } ?> |
|
|
Josh, redacted – Event Espresso support team – LOC |
|
Sorry I didn’t even copy and paste the code right, I need a drink. redacted – Event Espresso support team – LOC |
There’s multiple ways to do this, but here is an example:
Replace line 145 of the widget.php template file with the above. I’ve spaced that out a little so you can follow how it works a little easier. That code uses the code @Dean provided when the $event->start_date and $event->end_date values don’t match, otherwise it will use the default output.
|
|
The support post ‘Editing widget display’ 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.