Home › Forums › Calendar Products › Events Calendar PRO › Hide End Time of an event in List widget, Month View, and Event Page
- This topic has 2 replies, 3 voices, and was last updated 8 years, 10 months ago by Support Droid.
-
AuthorPosts
-
June 23, 2015 at 3:31 pm #972378cesuaParticipant
Hi, like the title of my post says, I’d like to know how to hide the End Time of an event in List widget, Month View, and Event Page.
Thanks.
June 24, 2015 at 6:43 am #972543NicoMemberHi cesua,
Thanks for hitting the forums on this!
If your events are single day events you can add this snippet to your ‘functions.php’ file – located at ‘wp-content/themes/your_theme/’. It will hide end time from single events, list widget and tooltip in month view.
add_filter( 'tribe_events_event_schedule_details_formatting', 'change_schedule_format' );
function change_schedule_format( array $format ) {
$format['show_end_time'] = false;
return $format;
}
If your events start date and end date are not on the same day, you’ll need to create some template overrides to hide the end date – I’ll outline the steps here but please check our Themer’s Guide for further details.
For the single event view:
1. Copy the file ‘single-event.php’ from ‘wp-content/plugins/the-events-calendar/src/views/’ to ‘wp-content/themes/your_theme/tribe-events/’ (create the tribe-events folder if necessary).
2. Open the file you just copied over to your theme folder.
3. Replace line 36 of the file:
//replace this line
<?php echo tribe_events_event_schedule_details( $event_id, '<h3>', '</h3>' ); ?>
//whit this one
<h3><?php echo tribe_get_start_date(); ?></h3>
4. Save the file and test.For the list view the steps are the same, but the template location and lines to edit change:
– List view: template is located at ‘wp-content/plugins/the-events-calendar/src/views/widgets/list-widget.php’ and should be copied to ‘wp-content/themes/your_theme/tribe-events/widgets/’. Line to edit is 54.Regarding month view, do you want to edit the tooltip?
Let me know if the code provided worked for you,
Best,
NicoJuly 9, 2015 at 7:30 am #985029Support DroidKeymasterThis topic has not been active for quite some time and will now be closed.
If you still need assistance please simply open a new topic (linking to this one if necessary)
and one of the team will be only too happy to help. -
AuthorPosts
- The topic ‘Hide End Time of an event in List widget, Month View, and Event Page’ is closed to new replies.