Home › Forums › Calendar Products › Events Calendar PRO › Separate the Start Date from the Start Time in List View
- This topic has 3 replies, 2 voices, and was last updated 8 years, 6 months ago by
ghrahams.
-
AuthorPosts
-
September 5, 2017 at 7:20 am #1344828
ghrahams
ParticipantHi There,
I’m customizing the List view to show in table format.
see: http://wildmtyoga.com/classes/list/
Currently this block of code displays the Event Start Date and Time, and the End Time.
<div class="tribe-event-schedule-details">
<?php echo tribe_events_event_schedule_details() ?>
</div>
I would like to separate the Start date, ie “Mon, Sept 4” from the start time & end time “10:30am – 1:30pm”
My end goal is to style the Start Date “Mon, Sept 4” on it’s own line, and also style the Start time and End time “10:30am-1:30pm” on it’s own line so that it’s html output looks more like:
<span class="Start Date">Mon, Sept 4</span>
<span class="Event Time">10:30am -1:30pm</span>
Can you direct me to the template file, or perhaps a function needed to achieve this goal? Thank you!!
September 6, 2017 at 1:37 pm #1345656Andras
KeymasterHello grahams, welcome to the forums!
Thanks for the question, let me try to help you with this.
The template file you are looking for is this one:
wp-content\plugins\the-events-calendar\src\views\list\single-event.php
Best is to create a template override in this folder:
wp-content/themes/[your-theme]/tribe-events/list/single-event.php
You can read more about template overrides in our Themer’s Guide.
And you will likely need these two functions:
Or you can do it using a small snippet like the below. Just paste it into your functions.php file:
https://gist.github.com/andrasguseo/3a514035dc6d300cbf6851677e429786
This changes the output of the events schedule details according to what you put in there. Note that this might change it on all view which are based on the list view, e.x. the Event List widget. I haven’t been able to fully test that.
The safest bet would be the top solution with the template override. Check though, your theme might already have one. If that’s the case, then definitely use a child theme, and create an override of the file in the parent theme.
Let me know how this works out.
Cheers,
AndrasSeptember 28, 2017 at 9:38 am #1356200Support Droid
KeymasterHey 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 -
AuthorPosts
- The topic ‘Separate the Start Date from the Start Time in List View’ is closed to new replies.
