Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the pue-sales domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the better-click-to-tweet domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the pue-amazon domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the pue-stats domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the wordpress-seo domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114
Event Listing with Time | Event Espresso - Staging Server

Support

Home Forums Event Espresso Premium Event Listing with Time

Event Listing with Time

Posted: October 26, 2013 at 5:38 pm

Viewing 2 reply threads


Scott Ficek

October 26, 2013 at 5:38 pm

I recently asked about how to add the time to the event listing. You can find that thread here:
http://staging.eventespresso.com/topic/event-listing-with-more-details/

Right now it shows in military time. I tried to modify the code slightly to use AM & PM, but it now just always displays 6:00pm. Must be a syntax thing. Any ideas:

<p id=”p_event_start_time-<?php echo $event_id ?>” class=”event_start_time”><span class=”section-title”><?php echo __(‘Start Time: ‘, ‘event_espresso’); ?></span><?php echo date(“g:i a.”,$event->start_time) ?></p>


Dean

  • Support Staff

October 28, 2013 at 12:52 am

Hi Scott,

The issue here is that your trying to convert the format of a string, rather than time.

At the very least you will need to strtotime the start_time.

I would suggest something like this, it uses the default WordPress time format:

<?php $timeformat = get_option('time_format'); $new_start_time = date($timeformat, strtotime($event->start_time)); ?>

<p id="p_event_start_time-<?php echo $event_id ?>" class="event_start_time"><span class="section-title"><?php echo __('Start Time: ', 'event_espresso'); ?></span><?php echo $new_start_time; ?></p>

http://php.net/manual/en/function.strtotime.php


Scott Ficek

October 28, 2013 at 5:43 pm

Woohoo! That worked.

Thank you.

Viewing 2 reply threads

The support post ‘Event Listing with 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 - Staging Server