Skip to content

Instantly share code, notes, and snippets.

@bordoni
Created February 4, 2020 21:07
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 bordoni/6c332b460893f385b689213ad352b8ad to your computer and use it in GitHub Desktop.
Save bordoni/6c332b460893f385b689213ad352b8ad to your computer and use it in GitHub Desktop.
<?php
$args = [
'ends_after' => 'now',
'event_category_not_in' => [ 'seasonal-services', 'facility-schedule' ],
'posts_per_page' => 2,
];
$orm = tribe_events()->by_args( $args );
$events = $orm->all();
?>
<ul class="feed">
<?php if ( $events ) :?>
<?php foreach( $events as $event ): ?>
<li>
<article class="article">
<div class="date">
<?php echo tribe_get_start_date( $event->ID, false, 'F j, Y' ); ?>
</div>
<h3 class="title">
<a
href="<?php echo esc_url( get_the_permalink( $event->ID ) ); ?>"
rel="bookmark"
title="Permanent Link to <?php the_title_attribute( [ 'post' => $event->ID ] ); ?>"
>
<?php echo get_the_title( $event->ID ); ?>
</a>
</h3>
</article>
</li>
<?php endforeach; ?>
<?php else: ?>
<li><?php esc_html_e('Sorry, no posts matched your criteria.'); ?></li>
<?php endif; ?>
</ul>
<div class="dig-in"><a href="<?php bloginfo('url'); ?>/events/month/">See all Upcomming Events &raquo;</a></div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment