Support

Home Forums Event Espresso Premium Edit the Events Table View Template Add-on to show Start time and end time

Edit the Events Table View Template Add-on to show Start time and end time

Posted: November 22, 2017 at 5:27 am


Susan Stevens

November 22, 2017 at 5:27 am

Hi
I am currently customising the Event Table View Template Addon to display few extra columns in my table. After searching the forum, I managed to add the “Price” column to display the ticket price. I also want to display the Date (pnly the start date) and “Start Time” and “End Time” in three separate columns rather than in one column called “Date”. Can you please help me achieve this?

Thanks in advance.


Josh

  • Support Staff

November 22, 2017 at 6:59 pm

Hi adora914,

If you look through the in the template code you’ll find the line of code that displays the start date and time:

<?php echo date_i18n( $date_format . ' ' . $time_format, strtotime( $datetime->start_date_and_time('Y-m-d', 'H:i:s') ) ); ?>

To change that column so it only displays the date, you change the code to be:
<?php echo date_i18n( $date_format, strtotime( $datetime->start_date('Y-m-d') ) ); ?>

Then when you add more columns to display the start time and end time in their own columns, you’ll use this code to display the start time:

<?php echo date_i18n( $time_format, strtotime( $datetime->start_time('H:i:s') ) ); ?>

and you’ll use this code to display the end time:
<?php echo date_i18n( $time_format, strtotime( $datetime->end_time('H:i:s') ) ); ?>


Susan Stevens

November 23, 2017 at 4:54 am

Hi Josh
Thanks a lot for the quick response. It worked well and now I am able to display all the date time columns.

Could you also let me know how I can include the remaining seats in there as well?

Also, this table view is not responsive and unfortunately I cannot even view the Register link in my phone. This is a real issue coz this is the front page of the website where people can click on to register. I read somewhere that the Toggle template can be used for responsive issues. I want to know whether there is a way for me to use the Toggle template just for mobile and use the full table template for other devices?

Really looking forward to a favourable response. So far the plugin is working really well for my requirement and it would be great if I can get this responsive issue resolved.

Regards
Anu


Josh

  • Support Staff

November 23, 2017 at 10:31 am

Could you also let me know how I can include the remaining seats in there as well?

<?php echo $post->EE_Event->total_available_spaces(); ?>

I want to know whether there is a way for me to use the Toggle template just for mobile and use the full table template for other devices?

One way is you install this plugin:
https://wordpress.org/plugins/wp-mobile-detect/

Which will allow for setting up the page with device specific shortcodes like this:

[phone][ESPRESSO_EVENTS_TABLE_TEMPLATE template_file=espresso-events-table-template-toggle.template.php][/phone]
[notphone][ESPRESSO_EVENTS_TABLE_TEMPLATE][/notphone]

The support post ‘Edit the Events Table View Template Add-on to show Start time and 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