Skip to content

Instantly share code, notes, and snippets.

@paulgeisler
Forked from jo-snips/custom-past-events.php
Created November 20, 2013 21:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paulgeisler/7571354 to your computer and use it in GitHub Desktop.
Save paulgeisler/7571354 to your computer and use it in GitHub Desktop.
<?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(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment