WordPress.org

Ready to get started?Download WordPress

Forums

All-in-One Event Calendar
[resolved] Show Upcoming Events Only (3 posts)

  1. Rosencruez
    Member
    Posted 1 year ago #

    I'm trying to display upcoming events only (so no past events) using the WP_Query() function. I see there is a "wp_ai1ec_events" table in the database and a column named "start" with the start times in yyyy-mm-dd hh:mm:ss format. I can get the current time in the same format using $currentTime = current_time('mysql')

    This is what my query looks like so far:

    $frontpageevents='post_type=ai1ec_event&showposts=3&orderby=start&order=ASC&meta_value=yes';
    $eventquery = new WP_Query($frontpageevents);

    I've tried adding '&start>'.$currentTime to the end of the $frontpageevents declaration, but that didn't work. I was hoping if someone knew how to handle this.

    http://wordpress.org/extend/plugins/all-in-one-event-calendar/

  2. Ula Szczepaniak
    Member
    Posted 1 year ago #

    Hi,

    Did you try another way to do this? AI1EC has a nice function get_events_between.
    You can use it simple:

    $events = $ai1ec_calendar_helper->get_events_between( $s_time, $e_time );
    and you set $s_time and $e_time you want it.

    Regards

  3. Richard
    Member
    Posted 1 year ago #

    This post is 2 weeks old and there have been no replies, so I am marking it as 'resolved.'

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags