Hi. I want to again thank you for helping me out last week to figure out how to get my divs to be styled based on event category.
I am having another issue and I’m not sure it has something to do with the update to 1.7 or something I’m just overlooking.
http://artsriot.com/slider-test/
Here you will see the slider, some of the slides are linked to an event . . . previously on the slides that were linked to posts that were events, the date would show up after the “|” pipe in the title. The date no longer shows up and I’m not quite sure why. Does something in this code look suspect? The only thing I can think of is that something changed when I updated to the 1.7 plugin. Thanks for any help! – Mattey
if (get_post_type() == "event") {
$date_format = (eo_is_all_day() ? 'M jS' : 'M jS @ g:ia');
//$start = eo_get_the_start("Y-m-d", get_the_ID());
//$end = eo_get_the_end("Y-m-d,", get_the_ID());
$start = $post->StartDate;
$end = $post->EndDate;
if ($start < $end) {
$the_date = eo_get_the_start("M jS", get_the_ID())." - ".eo_get_the_end("M jS", get_the_ID());
} else {
$the_date = eo_get_the_start($date_format, get_the_ID());
}
$the_date = " | ".$the_date;
} else {
$the_date = "";
}
Mattey
FYI – The “PechaKucha Night, Volume 9” is an example of the slide that should have a date after the “|”.
Mattey
Nothings changed – but you should use the API rather than the $post
object: (Assuming you’re using it ‘inside the loop’).
if (get_post_type() == "event") {
$date_format = (eo_is_all_day() ? 'M jS' : 'M jS @ g:ia');
$start = eo_get_the_start("Y-m-d");
$end = eo_get_the_end("Y-m-d,");
if ($start < $end) {
$the_date = eo_get_the_start("M jS")." - ".eo_get_the_end("M jS");
} else {
$the_date = eo_get_the_start($date_format);
}
$the_date = " | ".$the_date;
} else {
$the_date = "";
}
Stephen Harris