Support

Home Forums Event Espresso Premium Styling Latest Events Widget Dates, Editing HTML Markup

Styling Latest Events Widget Dates, Editing HTML Markup

Posted: April 16, 2013 at 10:56 am


Lex Semenenko

April 16, 2013 at 10:56 am

Hello,

I need to style my Latest Events Widget.  Date & Time should look like an icon. To achieve this I need different html mark up. Something like this,

<p><span class=”icon”>16 <em>April</em></span> Event Title Here</p>

I found “widget.php” where code can be modified. Please help me with php to output month separate from date, year.

Thanks so much.


Dean

April 16, 2013 at 11:56 pm

Hello Lex,

The date is formatted by WordPress so there isn’t a straightforward way to separate the month and day out.

You could use the php explode function to separate the date string out, for example, I am using the date format April 17, 2013 so I would explode the string based on the comma.

$grab_date = event_date_display($event->start_date);

$separate_date = explode(',', $grab_date);

var_dump($separate_date);

this would give an array with April 17 and 2013 as separate items which can then be echoed out and modified accordingly.

Your set up may be different, but hopefully thats a starting point for you. If you are not sure about PHP then I would suggest looking at our Pros page where you can hire a developer.

The support post ‘Styling Latest Events Widget Dates, Editing HTML Markup’ 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