From 6feec3b38e04e8e697122dd627dcc6de4b01108a Mon Sep 17 00:00:00 2001 From: Brian Miyaji Date: Sun, 20 Sep 2015 21:58:44 +1000 Subject: [PATCH] Check if teams exist in countdown --- templates/countdown.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/templates/countdown.php b/templates/countdown.php index 692235c5..24594de3 100644 --- a/templates/countdown.php +++ b/templates/countdown.php @@ -46,13 +46,15 @@ if ( $link_events ) $title = '' . get_the_post_thumbnail( $team, 'sportspress-fit-icon' ) . ''; - } else { - echo get_the_post_thumbnail( $team, 'sportspress-fit-icon', array( 'class' => 'team-logo logo-' . ( $i % 2 ? 'odd' : 'even' ) ) ); + if ( is_array( $teams ) ) { + foreach ( $teams as $team ) { + $i++; + if ( has_post_thumbnail ( $team ) ) { + if ( $link_teams ) { + echo ''; + } else { + echo get_the_post_thumbnail( $team, 'sportspress-fit-icon', array( 'class' => 'team-logo logo-' . ( $i % 2 ? 'odd' : 'even' ) ) ); + } } } }