- This topic has 2 replies, 2 voices, and was last updated 5 years, 10 months ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
- The forum ‘How do I …’ is closed to new topics and replies.
Events Made Easy › Forums › How do I … › Search Results
Hi
In the search results I am using the code provided in the FAQ to display event results. It is working great, but I would like to ask if there is a way to format the date differently.
When I use:
print "<b>Date:</b> ".$event['event_start_date']."";
It returns: Date: 2019-01-26
Is there an alternative date format?
Also, is there a way to display the category from the even in this (should I use shortcodes here?)
Thanks
Jamie
You can use eme_localized_date on the date, it will format the date based on your wp settings. If you don’t like it, you can even add a second argument to it with your own formatting (php date formatters):
eme_localized_date($event[‘event_start_date’]);
or
eme_localized_date($event[‘event_start_date’],”MY FORMAT”);
There’s also a function eme_localized_time (for time formatting).
Thanks Franky
However, when I print that, it returns today’s date for all events, both start and end times.