Styling weekly event list where there is no event.

Home Forums Calendar Products Events Calendar PRO Styling weekly event list where there is no event.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #20133
    Jeremy
    Member

    Hi guys,

    I was wondering if there is a way to set up a style for days when there aren’t events. I’ve tried, both with WP_Query and tribe_get_events (using https://theeventscalendar.com/support/documentation/the-events-calendar-template-tags-general-functions/#functiontribe_get_events as an example) to call a day without an event, but only seems to get either
    A. the next available event
    B. the event that bleeds into said day (almost all events end at 2:00 am the next day)

    Mondays, there aren’t any recurring events but the client wants to promote the fact that people can host their own events. Example, our current calendar’s event list: http://curelounge.com/upcoming-events/#monday.

    Now, using The Events Calendar, here is the current call:

    global $post;
    $mondaysEvent = date(‘j M Y’, strtotime(‘this monday’));
    $get_posts = tribe_get_events(array(‘start_date’=>$mondaysEvent,’posts_per_page’=>1) );
    if($get_posts):
    foreach($get_posts as $post) {
    setup_postdata($post);

    /* event specific code */

    } // end foreach
    else:
    /* no event today specific code */
    endif;
    wp_reset_query();

    Forgive the lack of styling, but here is what that’s returning: http://curelounge.com/event-list/

    Any thoughts? Thank you!

    #20184
    Jonah
    Participant

    Hi Jeremy,

    Are you asking about detecting this only in the events list view? Have you looked through our documentation? https://theeventscalendar.com/support/documentation/

    – Jonah

    #20185
    Jonah
    Participant

    In the above query, that’s pretty much how you’d do it where if($get_posts) is blank do something else…

    #20471
    Jeremy
    Member

    Hi Jonah,

    Thanks for the response – yes, the above query is based on the documentation. (I’ve since taken down the page but it wasn’t returning properly. Example: I call Monday and it returned Tuesday’s event that ended Monday morning. I call Sunday and it returns Saturday’s event that ends Sunday morning at 2:00 a.m.)

    I have a feeling ECP is conflicting either with a plugin or some date.time declaration. I don’t have a resolution to this issue, but I don’t have an explanation to help out with the problem either so feel free to consider this topic closed.

    If I find out any more about why things are returning the way they are, I definitely report.

    Cheers.

    #20474
    Jonah
    Participant

    Sounds good Jeremy, I’m closing this thread.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Styling weekly event list where there is no event.’ is closed to new replies.