Hi there,
we’ve been trying to make our custom events archive and single pages – but unfortunately we’re unable to retrieve the correct date. Using WP the_date() will only return month and year.
We’ve tried to use eo_get_the_start( ) and pretty much any other function that is described in your docs, but failed to retrieve the event start time. The returns are usually “crazy” numbers, I suppose it’s because the start and end times are relative numbers that belong to a timezone? We’re aware that some functions return in PHP-datetime format but still weren’t able to display the correct time.
Please tell us how to display the start time in archive-event.php (copied from the event plugin templates) in the loop.
Thanks,
Manuel.
Manuel Geissinger
Hi Manuel,
You probably want to edit eo-loop-single-event.php
unless you want to edit the wider structure of the page.
In any case, you can do the following:
echo eo_get_the_start('G:ia');
The argument determines the format. http://codex.wp-event-organiser.com/function-eo_get_the_start.html
Stephen Harris
Hi Stephen,
I’ve tried now
echo eo_get_the_start('G:ia');
But as before the dates aren’t correct. The output is
0:00am
for every event, while in the WordPress backend the dates are displayed correctly.
Manuel Geissinger
Hi Manuel,
What do you get if you do:
global $post;
var_dump( $post->occurrence_id );
var_dump( $post->StartDate );
var_dump( $post->StartTime );
Stephen Harris