• Resolved hugomaffre

    (@hugomaffre)


    Hello,

    I need to display the previous, current and last event in my homepage.
    I used shortcodes like this one, here to show the last one.
    [events_list scope=”past” orderby=”event_end_date” order=”DESC” limit=1]
    But it only displays yesterday’s event.

    I guess it is because the precision of event_end_date is daily.
    I tried event_end_time ans event_end_hour but it failed.
    My events planning is full (it is a radio), so to get the current event, I only have to get the previous event start or the next event end.

    But I never get the right event.
    Is there a way to write a shortcode displaying the next event starting at 18pm for example, or is it only on days ?

    Thanks,
    Hugo

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support angelo_nwl

    (@angelo_nwl)

    another way is to create your own scope search attribute – http://wp-events-plugin.com/tutorials/create-your-own-event-scope/

    Thread Starter hugomaffre

    (@hugomaffre)

    Thanks for your answer,
    I successed for the current one.

    But how can I add several scope conditions ?
    I tried to make a function like in the example for each condition but it is not working,
    only the first one is doing it’s job.

    I did’nt forget to add each function in the array at the end.

    Hugo

    Thread Starter hugomaffre

    (@hugomaffre)

    I did it, all conditions needed to be in the same function.

    Here is my solution for the current one :

    $current_date = date(‘Y-m-d’,current_time(‘timestamp’));

    $conditions[‘scope’] = “(CURTIME() BETWEEN event_start_time AND event_end_time) AND event_start_date = CAST(‘$current_date’ AS DATE)”;

    This needs to be in the function.php file, it is not sayed in the tutorial !

    Hugo

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Last, current and next event’ is closed to new replies.