Skip to content

Instantly share code, notes, and snippets.

@trishasalas
Created May 23, 2017 02:58
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 trishasalas/4b1e2c5084b56c994843672d3a938ce1 to your computer and use it in GitHub Desktop.
Save trishasalas/4b1e2c5084b56c994843672d3a938ce1 to your computer and use it in GitHub Desktop.
<div class="small-12 medium-6 large-4 columns">
<?php
$events = tribe_get_events(
array(
'posts_per_page' => 1,
'orderby' => 'meta_value',
'order' => 'DESC',
) );
foreach ( $events as $event ) {
$terms = get_the_terms( $event->ID, 'tribe_events_cat' );
?>
<p class="home-cat">
<?php
foreach ( $terms as $term ) {
echo $term->name;
}
?>
</p>
<a href="<?php echo tribe_get_event_link( $event->ID ) ?>">
<?php echo tribe_event_featured_image( $event->ID, 'home-blog', true ); ?>
</a>
<div class="home-news-content clearfix">
<a href="<?php echo tribe_get_event_link( $event->ID ) ?>">
<h2><?php echo $event->post_title; ?></h2></a>
<p><?php echo $event->post_excerpt; ?></p>
<a class="home-read-more" href="<?php echo tribe_get_event_link( $event->ID ) ?>">
Read More
</a>
</div>
<?php wp_reset_postdata();
} ?>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment