Created
August 22, 2012 16:38
-
-
Save jo-snips/3427287 to your computer and use it in GitHub Desktop.
The Events Calendar: Custom Query for Past Events
This file contains 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 characters
<?php | |
global $post; | |
$get_posts = tribe_get_events(array('posts_per_page'=>-1, 'eventDisplay'=>'past') ); | |
foreach($get_posts as $post) { setup_postdata($post); | |
?> | |
<?php if ( has_post_thumbnail() ) { ?> | |
<div class="thumbList"> | |
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_post_thumbnail('thumbnail', array('class' => 'scale-with-grid attachment-thumbnail')); ?></a> | |
</div> | |
<div class="event-excerpt"> | |
<h6 class="event-title"><span class="front-start-time"><?php echo tribe_get_start_date( $post->ID, false, 'Y M j g:i a' ); ?> </span><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h6> | |
<?php the_excerpt(); ?> | |
</div> | |
<div class="clear"></div> | |
<?php } else { ?> | |
<h6 class="event-title"><span class="front-start-time"><?php echo tribe_get_start_date( $post->ID, false, 'Y M j g:i a' ); ?> </span><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h6> | |
<div class="event-content"> | |
<?php the_content(); ?> | |
</div> | |
<div class="clear"></div> | |
<?php } ?> | |
<?php } //endforeach ?> | |
<?php wp_reset_query(); ?> |
Thanks! But...where can I put the query?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanku so much it is working good