Support

Home Forums Event Espresso Premium Seperate Template Tags For Month/Day

Seperate Template Tags For Month/Day

Posted: January 15, 2014 at 2:43 pm

Viewing 1 reply thread


Josiah Cole

January 15, 2014 at 2:43 pm

Is there a way to extract/print *just* the event month name (ex: January), and/or the event day individually?

The purpose being I want to create a custom layout of upcoming events and want to style and place separately the month and the day/date for each event.

I am using custom post types and a custom loop now to display the upcoming 5 events. I use the $event_date to display the date but it prints the entire string.

Is this possible?


Sidney Harrell

January 15, 2014 at 3:13 pm

If you are using the page_event_list.php template, look up at line 61, where the $event_date variable gets created:

$event_date = do_shortcode('[EVENT_TIME event_id="'.$event_id.'" type="start_date" format="l, F j, Y"]'); // change the date format if you so desire http://php.net/manual/en/function.date.php

You could put a couple lines in right after that to create $event_month and $event_day variables as well:

$event_month = do_shortcode('[EVENT_TIME event_id="'.$event_id.'" type="start_date" format="F"]');
$event_day = do_shortcode('[EVENT_TIME event_id="'.$event_id.'" type="start_date" format="j"]');
Viewing 1 reply thread

The support post ‘Seperate Template Tags For Month/Day’ 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