Support

Home Forums Event Espresso Premium in EE3, how to show event time on event registration page

in EE3, how to show event time on event registration page

Posted: May 31, 2014 at 11:06 am


karen wang

May 31, 2014 at 11:06 am

on event registration page, we only see the date but not the time of the event. It is also the case on the upcoming event widget. I know i can click on register to see the details of an event, but would like to have time shown on the registration page and on upcoming event widget.

any setting that we can change to make this happen?

thanks,
karen


Dean

June 2, 2014 at 1:45 am

Hi Karen,

The time can be added in fairly easily to the event list, but you will need to edit a template file to do so.

Copy these two files:

/wp-content/plugins/event-espresso/templates/event_list.php
/wp-content/plugins/event-espresso/templates/event_list_display.php

The need to go in this location.

/wp-content/uploads/espresso/templates/

Then edit event_list_display.php and at approx line 131 just after the dat information add the following

<p id="event_date-<?php echo $event_id ?>"><span class="section-title"><?php _e('Time:', 'event_espresso'); ?></span>  <?php echo event_date_display($event->start_time, get_option('time_format')) ?>

That will add the start time into the list.

The widget is similar. Copy over the widget.php file and edit line 130 so it reads

<li><a href="<?php echo $registration_url; ?>"><?php echo stripslashes_deep($event->event_name) ?> - <span class="widget-event-date"><?php echo event_date_display($event->start_date) ?> - <?php echo event_date_display($event->start_time, get_option('time_format')); ?></span></a>

If you are not sure what to do with all this code, you may need assistance from your web developer.


karen wang

June 2, 2014 at 10:39 pm

for the first step, do you mean the following?
1) copying these two files:
/wp-content/plugins/event-espresso/templates/event_list.php
/wp-content/plugins/event-espresso/templates/event_list_display.php
2) paste them to /wp-content/uploads/espresso/templates/

IF so, i made a mistake by overwriting /wp-content/uploads/espresso/templates/.
1) how can i recover everything under /wp-content/uploads/espresso/templates/ ?
2) what does the directory do?

thanks,
karen


Dean

June 3, 2014 at 6:04 am

Hi,

for the first step, do you mean the following?
1) copying these two files:
/wp-content/plugins/event-espresso/templates/event_list.php
/wp-content/plugins/event-espresso/templates/event_list_display.php
2) paste them to /wp-content/uploads/espresso/templates/

Yes that’s correct.

IF so, i made a mistake by overwriting /wp-content/uploads/espresso/templates/.
1) how can i recover everything under /wp-content/uploads/espresso/templates/ ?

Recovery may be difficult. If you had any modifications in there then you would need to check if you had a backup (often backup plugins back up the uploads directory). If you didn’t have any modifications then it should not be an issue, as there would be nothing important in there.

2) what does the directory do?

The uploads/espresso/ directory is there so that you can copy over template files and modify them. That way updating the plugin will not delete your modifications.


karen wang

June 3, 2014 at 8:17 am

perfect!

we are a new customer so nothing to backup in that directory.
and your instruction works! I have event start and end time on the registration pages now. so happy!

another small enhancement request- how to remove year from the widget?
due to small real estate on the front page, showing the year of 2014 is meaningless.

thanks,
karen


Dean

June 4, 2014 at 2:29 am

Hi,

You’re welcome.

In the widget code you edited earlier you need to tweak it slightly. Chaneg it to this

<li><a href="<?php echo $registration_url; ?>"><?php echo stripslashes_deep($event->event_name) ?> - <span class="widget-event-date"><?php echo event_date_display($event->start_date, 'd-m') ?> - <?php echo event_date_display($event->start_time, get_option('time_format')); ?></span></a>

The important part here is the ‘d-m’ bit. As it is that will show 04-06 (4th June). You can modify the style by using the PHP date formats (http://php.net/manual/en/function.date.php)

e.g.

‘D jS M’ equals Wed 4th Jun
‘F jS’ equals June 4th


karen wang

June 4, 2014 at 3:40 pm

that is exactly what i needed.
Thank you so much!

The support post ‘in EE3, how to show event time on event registration page’ 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