Skip to content

Instantly share code, notes, and snippets.

@lorenzocaum
Last active August 29, 2015 14:13
Show Gist options
  • Save lorenzocaum/eee8c7d4a00051de8c37 to your computer and use it in GitHub Desktop.
Save lorenzocaum/eee8c7d4a00051de8c37 to your computer and use it in GitHub Desktop.
Add the event start time to the event title on the event list page and single event page in Event Espresso 3

This can be done by adjusting the some templates files for Event Espresso 3. Here the steps to do so:

  1. Login to your WordPress site with your preferred SFTP or FTP client. FileZilla and Cyberduck are free options. Try Transmit for Mac

  2. Browse to this location: /wp-content/plugins/event-espresso/templates

  3. Locate the following files and download a copy of them to your local computer:

event_list_display.php

event_list.php

AND

registration_page_display.php

registration_page.php

  1. Using your preferred FTP or SFTP client, browse to this location: /wp-content/uploads/espresso/templates

  2. Upload the four files that you recently downloaded to the location above

  3. Open the event_list_display.php file for editing and go to line 43. You’ll see some coding like this:

	<h3 id="event_title-<?php echo $event_id ?>" class="event_title ui-widget-header ui-corner-top"><a title="<?php echo stripslashes_deep($event_name) ?>" class="a_event_title" id="a_event_title-<?php echo $event_id ?>" href="<?php echo $registration_url; ?>"><?php echo stripslashes_deep($event_name) ?></a>
  1. Replace the coding with this and save changes:
	<h3 id="event_title-<?php echo $event_id ?>" class="event_title ui-widget-header ui-corner-top"><a title="<?php echo stripslashes_deep($event_name) ?>" class="a_event_title" id="a_event_title-<?php echo $event_id ?>" href="<?php echo $registration_url; ?>"><?php echo stripslashes_deep($event_name) ?> - <?php echo event_date_display($start_date, get_option('date_format')) ?></a>
  1. Open the registration_page_display.php file for editing and go to line 12. You’ll see some coding like this:
	<h3 class="event_title ui-widget-header ui-corner-top" id="event_title-<?php echo $event_id; ?>">
		<?php echo $event_name ?> - <?php echo event_date_display($start_date, get_option('date_format')) ?> <?php echo $is_active['status'] == 'EXPIRED' ? ' - <span class="expired_event">Event Expired</span>' : ''; ?> <?php echo $is_active['status'] == 'PENDING' ? ' - <span class="expired_event">Event is Pending</span>' : ''; ?> <?php echo $is_active['status'] == 'DRAFT' ? ' - <span class="expired_event">Event is a Draft</span>' : ''; ?>
	</h3>
  1. Replace the coding with this and save changes:
	<h3 class="event_title ui-widget-header ui-corner-top" id="event_title-<?php echo $event_id; ?>">
		<?php echo $event_name ?> - <?php echo event_date_display($start_date, get_option('date_format')) ?> <?php echo $is_active['status'] == 'EXPIRED' ? ' - <span class="expired_event">Event Expired</span>' : ''; ?> <?php echo $is_active['status'] == 'PENDING' ? ' - <span class="expired_event">Event is Pending</span>' : ''; ?> <?php echo $is_active['status'] == 'DRAFT' ? ' - <span class="expired_event">Event is a Draft</span>' : ''; ?>
	</h3>

Be sure to the save changes to the files that were edited above. You can then go to your event list page and a single event page to view your edits on your site.