Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Loop through dates in EE4
- // This is NOT supported by Event Espresso. It is just an EXAMPLE. It is also probably not that well optimized!
- // Use as a basis for your own code and at your own risk!
- ?>
- <?php
- //get the dates in an array we can loop through
- $the_dates = array(
- 'June 2015',
- 'July 2015',
- 'August 2015'
- );
- ?>
- <?php
- foreach ( $the_dates as $date ) {
- ?>
- <ul class="events">
- <?php
- $atts = array(
- 'title' => NULL,
- 'limit' => 100,
- 'css_class' => NULL,
- 'show_expired' => FALSE,
- 'month' => $date,
- 'category_slug' => NULL,
- 'order_by' => 'start_date',
- 'sort' => 'ASC',
- 'limit' => 3
- );
- // run the query
- global $wp_query;
- $wp_query = new EE_Event_List_Query( $atts );
- if (have_posts()) : while (have_posts()) : the_post();
- ?>
- <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
- <?php do_action( 'AHEE_event_details_after_the_event_title', $post ); ?>
- </li>
- <?php
- endwhile;
- else:
- ?>
- <li>No Upcoming Events</li>
- <?php
- endif;
- // now reset the query and postdata
- wp_reset_query();
- wp_reset_postdata();
- ?>
- </ul>
- <?php } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement