Skip to content

Instantly share code, notes, and snippets.

@lorenzocaum
Last active August 9, 2017 12:45
Show Gist options
  • Save lorenzocaum/9bab331ac6026fae9003 to your computer and use it in GitHub Desktop.
Save lorenzocaum/9bab331ac6026fae9003 to your computer and use it in GitHub Desktop.
Edit the Events Table View Template Add-on for Event Espresso 4 to show the a Day of Week column

This can be done by relocating one of the templates and making a change to some lines of code. This will ensure that your customization is not lost on a software update.

The support team at Event Espresso will never recommend you edit any core plugin or add-on files directly.

Here are the steps:

  1. Login to your WordPress root with your preferred SFTP or FTP client. Filezilla and Cyberduck are free options. On a Mac? Try Transmit

  2. Browse to this location:

/wp-content/plugins/eea-events-table-view-template/templates

You'll see two files there:

espresso-events-table-template-toggle.template.php

espresso-events-table-template.template.php

  1. Download a copy of the espresso-events-table-template.template.php file to your computer

  2. Now browse to your child theme:

/wp-content/themes/name-of-your-child-theme

Not using a child theme? A child theme allows you to customize your WordPress theme without losing customizations when you update your theme through WP. Here is how to setup a child theme.

  1. Upload the the file that you downloaded earlier to the location above

  2. Open the espresso-events-table-template.template.php file for editing

At about line 45 you'll see this line of code:

	<th class="th-group"><?php _e('Venue','event_espresso'); ?></th>
  1. Replace the line above with this:
	<th class="th-group"><?php _e('Venue','event_espresso'); ?></th>
	<th class="th-group"><?php _e('Day of the Week','event_espresso'); ?></th>
  1. At about line 53, you'll see this line of code:
			<td colspan="4">
  1. Replace it with this:
			<td colspan="5">
  1. At about line 111 you'll see this line of code:
		<td class="venue_title event-<?php echo $post->ID; ?>"><?php espresso_venue_name( NULL, FALSE ); ?></td>
  1. Replace the line above with this:
     <td class="venue_title event-<?php echo $post->ID; ?>"><?php espresso_venue_name( NULL, FALSE ); ?></td>
     <td class="day_of_week event-<?php echo $post->ID; ?>"><?php espresso_event_date_range( 'l', ' ', 'l', ' ', $event->ID() ); ?></td>

Then save changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment