Support

Home Forums Event Espresso Premium Show start and end time on single event page

Show start and end time on single event page

Posted: April 20, 2018 at 6:44 am


Createful

April 20, 2018 at 6:44 am

I’m using <?php espresso_event_date(); ?> to show the datetime of an event, on a custom sidebar on my single-espresso_events.php page template.

Right now this produces: 21st April 2018 10:00 am

But I want it to do look like this: 21st April 2018 10:00 am to 5:00 pm

How would I go about this? I’ve tried several other methods on this forum of showing start/end times, but none have worked.

Thanks


Josh

  • Support Staff

April 20, 2018 at 1:28 pm

Hi,

You can use the following:

<?php echo espresso_event_date('', '', false, false) 
. ' to ' 
. espresso_event_end_date(' ', '', false, false); ?>


Createful

April 23, 2018 at 1:51 am

Great, thanks that’s sorted it.

It would be really useful if calls, variables and shortcodes like this were listed in full in the documentation section of this site. Unless I’m being really dumb I’ve missed them somewhere. This would be a good place to list them for example: https://eventespresso.com/wiki/ee4-shortcodes-template-variables/


Josh

  • Support Staff

April 23, 2018 at 9:12 am

Hi there,

The best place to find that information is directly in the source. For example:

https://github.com/eventespresso/event-espresso-core/blob/master/public/template_tags.php#L502

You’ll note that each function there has a PHPdocblock that includes a list of each parameter accepted for the template tag.

The support post ‘Show start and end time on single event page’ 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