Created
September 9, 2012 23:04
-
-
Save jo-snips/3687846 to your computer and use it in GitHub Desktop.
Revisions
-
jo-snips created this gist
Sep 9, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,44 @@ <?php global $post; $current_date = date('j M Y'); $end_date = date('j M Y', strtotime('1 month')); echo 'Start Date:'. $current_date; echo 'End Date:'. $end_date; $all_events = tribe_get_events( array( 'start_date' => $current_date, 'end_date'=> $end_date, 'posts_per_page' => 5 ) ); foreach($all_events as $post) { setup_postdata($post); ?> <h3 class="entry-title"><a href="<?= tribe_get_event_link($post) ?>"><?php the_title(); ?></a></h3> <div style="margin-bottom: 1em"> <span class="event-date"><a href="<?= tribe_get_event_link($post) ?>"><?php echo tribe_get_start_date($post->ID, true, 'M j, Y'); ?></a></span> <?php if ( has_post_thumbnail() ) { ?> <div class="event-thumb"> <a href="<?= tribe_get_event_link($post) ?>"><?php the_post_thumbnail('thumbnail'); ?></a> </div> <div class="event-excerpt"> <?php the_excerpt(); ?> </div> <?php } else { ?> <div class="event-content"> <?php the_content(); ?> </div> <?php } ?> </div> <?php } ?> <?php wp_reset_query(); ?>