Support » Plugin: Event Organiser » Weekend Events

  • gamenzie

    (@gamenzie)


    I’m trying to create a page that will display the poster board showing events that are taking place “this” weekend. By that I mean:

    1) If it’s currently Monday to Wednesday it will display all events taking place from the upcoming Thursday until the upcoming Sunday

    2) If it’s currently Thursday to Sunday it will show the events taking place which have yet to expire and end by the upcoming Sunday

    Basically a list that updates every Monday and shows the next weekend’s events.

    Unfortunately, it requires alternating ‘Thursday’ and ‘Next Thursday’ in the short code.

    Any suggestions appreciated if this is even possible.

    Thanks.

Viewing 1 replies (of 1 total)
  • Plugin Author Stephen Harris

    (@stephenharris)

    I’ve not tested, but does this week thursday and this week sunday do what you want it to? (It assumes a Monday-Sunday week, rather than Sunday-Saturday).

    Othwerise, you can create a custom shortcode which just invokes the posterboard shortcode, but setting the parameters has required.

    E.g.

    
    $today = new DateTime();
    
    // Day of week Monday = 1,... Thursday = 4,..., Sunday = 7
    $day_of_week = $today->format('N');
    
    if ( $day_of_week <= 4 ) {
       $attributes = " event_start_after='this thursday' event_end_before='this sunday'";
    } else {
       $attributes = " event_start_after='last thursday' event_end_before='this sunday'";
    }
    
    do_shortcode( "[event_board $attributes]" );
    
Viewing 1 replies (of 1 total)
  • The topic ‘Weekend Events’ is closed to new replies.