Support

Home Forums Event Espresso Premium Display Event Date on custom page template in a different format?

Display Event Date on custom page template in a different format?

Posted: February 1, 2016 at 3:06 pm


Josh

  • Support Staff

February 2, 2016 at 4:06 pm

Hi Erin,

There’s a template tag that you can call. It’s in the public/template_tags.php file, which in most cases should be loaded up. It will accept a date format parameter and the event ID.

Here are a few examples based on the formats you asked about:

<?php
$event_id = 123;
espresso_event_date ( 'm/d', '', $event_id, true);
espresso_event_date ( 'F j, Y', '', $event_id, true); ?>


ted@tedleonhardt.com

February 2, 2016 at 6:51 pm

Thank you so much, Josh! That’s exactly what I needed. In order to not show the time, I put a space between the quote marks so it ended up like:

<?php
$event_id = 123;
espresso_event_date ( 'm/d', ' ', $event_id, true);
espresso_event_date ( 'F j, Y', ' ', $event_id, true); ?>


Josh

  • Support Staff

February 3, 2016 at 8:55 am

You’re welcome.

The support post ‘Display Event Date on custom page template in a different format?’ 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