Skip to content

Commit

Permalink
fix the events block
Browse files Browse the repository at this point in the history
  • Loading branch information
dphiffer committed Jan 27, 2025
1 parent 1cc5b36 commit 9555760
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions wp-content/themes/mediasanctuary/sections/section-events.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,14 @@
// ]
]);

$count = 0;
if (count($events) > 3) {
$events = array_slice($events, 0, 3);
}
foreach ( $events as $post ) {
setup_postdata( $post );
if ( get_post_meta($post->ID, '_tribe_events_status', true ) == 'canceled' ) {
continue;
}
$count++;

$thumb_url = get_asset_url('img/default.jpg');
if ( has_post_thumbnail() ) {
Expand All @@ -61,7 +62,6 @@
<h5><?php echo $post->post_title;?></h5>
</a>
</li>
<?php if ($count == 3) { break; } ?>

<?php } ?>
</ul>
Expand Down

0 comments on commit 9555760

Please sign in to comment.