Skip to content

Instantly share code, notes, and snippets.

@BeardedGinger
Last active April 8, 2024 16:22
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BeardedGinger/7886729d4a8db2360e40 to your computer and use it in GitHub Desktop.
Save BeardedGinger/7886729d4a8db2360e40 to your computer and use it in GitHub Desktop.
<?php
$terms = array( 'citywide', 'central', 'east', 'west', 'seasonal' );
foreach( $terms as $term ) {
$events = tribe_get_events(
array(
'posts_per_page' => 4,
'tax_query' => array(
array(
'taxonomy' => 'tribe_events_cat',
'field' => 'slug',
'terms' => $term,
),
)
)
);
foreach( $events as $event ) {
// Add your event markup here example below
echo '<h2>'.$event->post_title.'</h2>'
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment