Support

Home Forums Event Espresso Premium Event List Start Date, Start Time, End Date, End Time

Event List Start Date, Start Time, End Date, End Time

Posted: November 26, 2013 at 6:05 pm


Sean Collishaw

November 26, 2013 at 6:05 pm

Aaaaand another time related question. On the page that uses the EVENT_LIST short code (http://www.climbcrux.org/events/), I would also like to display the Start / End Date and Time. Currently it’s showing “Date: ” with the iCal link. I would this to change to be

“Starts: <start date> <start time> <iCal Link>”
“Ends: <end date> <end time>”

Of course changing “Date:” to “Starts:” is the easy part. It’s getting the start time, end date, and end time to display where I’m losing my mind. πŸ™‚

The current code for the event meta (starting with the featured image) in the event_list_display.php file (in the /uploads/espresso/templates folder) is at http://pastebin.com/9Cma6pcF


Dean

November 27, 2013 at 2:22 am

Hi,

OK, so you have something like this in the file.

<p id="event_date-<?php echo $event_id ?>"><span class="section-title"><?php _e('Date:', 'event_espresso'); ?></span><?php echo event_date_display($start_date, get_option('date_format')); ?>
<?php //Add to calendar button
echo apply_filters('filter_hook_espresso_display_ical', $all_meta);?>
</p>

You can use this to create the end date and also the times, like so

<p id="event_date-<?php echo $event_id ?>"><span class="section-title">
<?php _e('Starts:', 'event_espresso'); ?></span>
<?php echo event_date_display($start_date, get_option('date_format')); ?>
<?php echo " "; //just a space ?>
<?php echo event_date_display($event->start_time, get_option('time_format')); ?>
<?php echo " "; //just a space ?>
<?php //Add to calendar button
echo apply_filters('filter_hook_espresso_display_ical', $all_meta);?>
</p>

<p id="event_date-<?php echo $event_id ?>"><span class="section-title"><?php _e('Ends:', 'event_espresso'); ?></span><?php echo event_date_display($end_date, get_option('date_format')); ?>
<?php echo " "; //just a space ?>
<?php echo event_date_display($event->end_time, get_option('time_format')); ?>

</p>


Sean Collishaw

November 27, 2013 at 4:44 pm

Clearly I’m missing something now. πŸ™

I’ve placed a copy of event_list_display in /wp-content/uploads/espresso/templates and that’s what I’m working on. However, adding the code you’ve provided above doesn’t change anything on the site (http://www.climbcrux.org/events/ — thats’ the page with the [EVENT_LIST] short code). I’ve even just tried changing the text of “Date:” in the original code snippet I sent to something else like “Dates:” but nothing on the site changes. Am I futzing around with the wrong template?


Dean

November 28, 2013 at 12:55 am

Did you copy over the event_list.php file as well? If not do so, even if you are not editing it, the files are linked so wont work with both being there.


Sean Collishaw

November 29, 2013 at 3:54 pm

Ah-hah! That’s the issue. Once I moved event_list.php over, everything started working. Thanks!! πŸ˜€

The support post ‘Event List Start Date, Start Time, End Date, End Time’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso