Updated to 1.7, date not showing up . . .

WordPress Event Management, Calendars & Registration Forums General Question Updated to 1.7, date not showing up . . .

This topic contains 2 replies, has 2 voices, and was last updated by  Stephen Harris 11 years, 10 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #3423

    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
    #3424

    FYI – The “PechaKucha Night, Volume 9” is an example of the slide that should have a date after the “|”.

    Mattey
    #3426

    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
Viewing 3 posts - 1 through 3 (of 3 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.