WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
[resolved] showing only upcoming event from series in [events_list] (7 posts)

  1. asafche
    Member
    Posted 1 year ago #

    when i'm using the short code [events_list], when i have some events series, i'm getting several occurrences. i would like to limit the events_list to show only one occurrence from each reoccurring events series.

    how can i achieve this?

    http://wordpress.org/extend/plugins/events-manager/

  2. agelonwl
    Member
    Posted 1 year ago #

  3. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 1 year ago #

    the shortcode wouldn't help, maybe the suggested link will.

    You'd need to add some PHP to acheive this.

  4. asafche
    Member
    Posted 1 year ago #

    i'm guessing you did not understood me.
    the search attributes doesn't have this option -
    if the reoccurring event has two instances, show only the closest to today.
    for now the list with this query gives doesn't give me what i want:
    <?php echo EM_Events::output(array('limit'=>10, 'scope'=>'future', 'orderby'=>'start_date')); ?>

  5. agelonwl
    Member
    Posted 1 year ago #

    you can try something like

    echo EM_Events::output(array('limit'=>10, 'scope'=>'future', 'orderby'=>'event_start_date', 'order'='ASC', 'pagination'=1 ));

    'orderby'=>'event_start_date' instead of 'orderby'=>'start_date'

  6. asafche
    Member
    Posted 1 year ago #

    No. Didn't worked. Still showing all the events of the event series on the list.
    Something else i should try?

  7. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 1 year ago #

    at the moment we don't have a feature which will only show the first recurring event, you'd need to code something in yourself to achieve this.

    You'd probably want to hook into something like this line:

    $results = $wpdb->get_results(apply_filters('em_events_get_sql',$sql),ARRAY_A);

    and add a GROUP BY clause

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic