Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- global $ai1ec_calendar_helper;
- global $ai1ec_events_helper;
- // Get localized time
- $timestamp = $ai1ec_events_helper->gmt_to_local( time() );
- $events_per_page = 3;
- // Set $limit to the specified category/tag
- $limit = array(
- 'cat_ids' => '',
- 'tag_ids' => '',
- 'post_ids' => '',
- );
- // Get events, then classify into date array
- $event_results = $ai1ec_calendar_helper->get_events_relative_to(
- $timestamp, $events_per_page, 0, $limit );
- $dates = $ai1ec_calendar_helper->get_agenda_date_array( $event_results['events'] );
- if( ! $dates ) :
- ?>
- <p class="ai1ec-no-results">
- <?php _e( 'There are no upcoming events.', AI1EC_PLUGIN_NAME ); ?>
- </p>
- <?php else: ?>
- <ol>
- <?php foreach( $dates as $timestamp => $date_info ): ?>
- <?php foreach( $date_info['events'] as $category ): ?>
- <?php foreach( $category as $event ): ?>
- <li><!-- Review file agenda-widget.php --></li>
- <?php endforeach; ?>
- <?php endforeach; ?>
- <?php endforeach; ?>
- </ol>
- <?php
- endif;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement