Skip to content

Instantly share code, notes, and snippets.

@lorenzocaum
Last active August 9, 2017 12:33
Show Gist options
  • Save lorenzocaum/8e7479f36f3780a93074f4ed5c66266b to your computer and use it in GitHub Desktop.
Save lorenzocaum/8e7479f36f3780a93074f4ed5c66266b to your computer and use it in GitHub Desktop.
How to remove the end time from the [ESPRESSO_MY_EVENTS] page for the WP User Integration in Event Espresso 4

This can be done by using moving a copy of the content-espresso_my_events-event_section.template.php to a child theme's folder and then making changes to remove end time.

The content-espresso_my_events-event_section.template.php file can be found in this location

/wp-content/plugins/eea-wp-user-integration/templates/content-espresso_my_events-event_section.template.php

Step 1) Copy the content-espresso_my_events-event_section.template.php into your child theme's folder.

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.

Step 2) Open the file and go to about line 28:

		<?php espresso_event_date_range('', '', '', '', $event->ID() ); ?>

Change it to this:

					$html .= '<span class="dashicons dashicons-clock"></span>' . $datetime->start_time( $time_format );

Then save changes.

You can then head to one of your single event pages and you'll see that only the start time is shown. Below is an example for an event that takes place on March 5.

Before (default option shows start and end time): http://cl.ly/420R1a2n2Q2I

After (shows only start time): http://cl.ly/0j191g210834

Addendum

Remove the time range altogether

In step 2, look for this line at about line 642:

					$html .= '<span class="dashicons dashicons-calendar"></span>' . $datetime->date_range( $date_format ) . '<br/>';
					$html .= '<span class="dashicons dashicons-clock"></span>' . $datetime->time_range( $time_format );

Then replace it with this:

					$html .= '<span class="dashicons dashicons-calendar"></span>' . $datetime->date_range( $date_format );
					//$html .= '<span class="dashicons dashicons-clock"></span>' . $datetime->time_range( $time_format );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment