Help Desk

Adding Start Time to Event Calendar

  • Posts: 8 Topics: 3
    | Permalink

    On our website calendar, we wanted to add the start times to event calendar. I had originally tried using https://theeventscalendar.com/knowledgebase/add-start-time-to-event-title/, but that had broke the ability to view attendees within the dashboard.

    So, I tried an alternate method that I had read about on your website, of editing the /month/single-event.php file. I added to the file in place of what was there.

    Now, the problem is that for events that span all day, it’s showing 12 am as the start time, which we don’t want.

    Any suggestions on what to do?

    Thanks,

    Posts: 4920
    | Permalink

    Hello,

    I’m sorry that you’ve had such a hard time getting the start time added…I just tested out the snippet in the article that you linked to in my local environment, but I was not able to recreate the issue with the attendees that you described. However, if this method is causing problems on your site, then the template override might be your better option.

    Can you please send me a copy of your template via a gist?

    Please note that customizations are outside the scope of support that we are able to provide here in the forums, but I will be happy to take a look and point you in the right direction!

    Thanks,

    Jennifer

    Posts: 8 Topics: 3
    | Permalink

    This isn’t a customization. This is something that I came across on Google in a support ticket as replied to by one of your support reps. See https://theeventscalendar.com/support/forums/topic/show-time-in-month-view-and-list-view/. This is exactly what I’m using in my template file, nothing more.

    Thanks,

    Posts: 4920
    | Permalink

    Hello,

    Thanks for sending the link! That post was from 2014, so I’m afraid that code’s a bit outdated by now. Code snippets like this that we provide in the forums are customizations, and even though they are outside the scope outlined in our forum guidelines, we do try to help whenever possible.

    Going with the template override, try replacing the code in your copy of the /month/single-event.php file with the following:

    <?php $start_time = tribe_get_start_time( $post->ID ); ?>
    
    <div id="tribe-events-event-<?php echo esc_attr( $event_id ); ?>" class="<?php tribe_events_event_classes() ?>" data-tribejson='<?php echo esc_attr( tribe_events_template_data( $post ) ); ?>'>
        <h3 class="tribe-events-month-event-title"><a href="<?php echo esc_url( $link ) ?>" class="url"><?php echo $start_time . ' ' . $title  ?></a></h3>
    </div>
    
    <!-- #tribe-events-event-# -->

    Note that you’ll want to save this version as [your-theme]/tribe-events/month/single-event.php (see our themer’s guide for additional instructions) instead of making the changes directly in the plugin files.

    Please let me know if this works for you!

    Thanks,

    Jennifer

    Posts: 8 Topics: 3
    | Permalink

    That did the trick – thanks!

    Posts: 4920
    | Permalink

    No problem!

    If there is anything else I can help with, please let me know.

    Posts: 7
    | Permalink

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

    | Permalink

The topic ‘Adding Start Time to Event Calendar’ is closed to new replies.