From a72c045a5bad71d3b5de39ec854644b27ddf2f88 Mon Sep 17 00:00:00 2001 From: Brian Miyaji Date: Tue, 26 Aug 2014 02:16:38 +1000 Subject: [PATCH] Display player positions only if array --- templates/player-details.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/player-details.php b/templates/player-details.php index 882d58c6..e48b736f 100644 --- a/templates/player-details.php +++ b/templates/player-details.php @@ -36,9 +36,9 @@ endif; $position_names = array(); $positions = get_the_terms( $id, 'sp_position' ); -foreach ( $positions as $position ): +if ( $positions ): foreach ( $positions as $position ): $position_names[] = $position->name; -endforeach; +endforeach; endif; $common[ __( 'Position', 'sportspress' ) ] = implode( ', ', $position_names );