Support » Plugin: Event Calendar » [eventlist] sorting to show events sorted by date

Viewing 3 replies - 1 through 3 (of 3 total)
  • I’m having a similar issue, the eventlist is sorting by category first, then date.
    E.g. using shortcode:
    [eventlist limit=6 categories=”1,3,4″]

    only shows the first 6 events from category 1 even though the other categories (3 and 4) have events scheduled on dates preceding the second category 1 evenr displayed in the list.

    I’d suggest changing the MySQL ORDER BY clause in the SELECT statement for event list to:
    ORDER BY wp_aec_event.start DESC, wp_aec_event.category_id

    Having looked a the code the SQL appears correct:

    $result = $wpdb->get_results("SELECT
      FROM " . $wpdb->prefix . AEC_EVENT_TABLE . "
      WHERE (
      (start >= '{$start}' AND start < '{$end}')
      OR (end >= '{$start}' AND end < '{$end}')
      OR (start <= '{$start}' AND end >= '{$end}')
      OR (start < '{$end}' AND (repeat_freq > 0 AND repeat_end >= '{$start}'))
      {$andcategory} ORDER BY start{$limit};");

    assuming the shortcode in question is using the function db_query_events(), and I’m not sure how to test this assumption on my site.

    Any ideas would be much appreciated.

    Same here: I simply cannot find a possibility to sort the event starting with the newest date…
    any help on this would be deeply appreciated 🙂

    anyway: the plugin itself is very easy to install and to use

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[eventlist] sorting to show events sorted by date’ is closed to new replies.