Support » Plugin: Simple Event Management – Sugar Calendar (Lite) » Recurring events not showing up in widget

Viewing 1 replies (of 1 total)
  • The UPCOMING functionality has this same problem. Here’s a custom loop that shows only upcoming events (even if they recur beginning in the past):

    <?php // Upcoming Events Loop
    $time = current_time( 'timestamp' );
    $now = mktime( 0, 0, 0, date( 'n', $time ), date( 'd', $time ), date( 'Y', $time ) );
    $event_future = array(
        'post_type'      => 'sc_event',
        'posts_per_page' => 99,
        'meta_key'       => 'sc_event_date_time',
        'orderby'        => 'meta_value_num',
        'order'          => 'asc',
        'post_status'    => 'publish',
        'meta_query' => array(
        	'relation' => 'OR',
            array(
                'key' => 'sc_recur_until',
                'value' => $now,
                'compare' => '>='
            ),
            array(
                'key' => 'sc_event_end_date_time',
                'value' => $now,
                'compare' => '>='
            )
        )
    );
    $events = get_posts( apply_filters('sc_event_list_query', $event_future) );
    foreach ( $events as $post ) : setup_postdata( $post ); ?>
Viewing 1 replies (of 1 total)
  • The topic ‘Recurring events not showing up in widget’ is closed to new replies.