diff --git a/assets/css/sportspress.css b/assets/css/sportspress.css index 918f1a09..41250907 100644 --- a/assets/css/sportspress.css +++ b/assets/css/sportspress.css @@ -292,6 +292,10 @@ padding-left: 10px; } +.sp-template-event-performance-icons .sp-player-position { + display: block; +} + /* Event Calendar */ .sp-event-calendar { border-spacing: 0; diff --git a/templates/event-performance-table.php b/templates/event-performance-table.php index 8fa96c0a..ced03ade 100644 --- a/templates/event-performance-table.php +++ b/templates/event-performance-table.php @@ -97,9 +97,8 @@ if ( ! isset( $subs ) ) $subs = array(); $name .= ' ' . sp_array_value( sp_array_value( $data, $subbed, array() ), 'number', null ) . ''; endif; - echo '' . $name . ''; - - if ( $mode == 'icons' ) echo ''; + $content = ''; + $position = null; foreach ( $labels as $key => $label ): if ( 'name' == $key ) @@ -133,7 +132,7 @@ if ( ! isset( $subs ) ) $subs = array(); $positions = array_unique( $positions ); if ( sizeof( $positions ) ): - $value = implode( ', ', $positions ); + $value = $position = implode( ', ', $positions ); endif; else: if ( array_key_exists( $key, $row ) && $row[ $key ] != '' ): @@ -149,18 +148,28 @@ if ( ! isset( $subs ) ) $subs = array(); endif; if ( $mode == 'values' ): - echo '' . $value . ''; + $content .= '' . $value . ''; elseif ( intval( $value ) && $mode == 'icons' ): $performance_id = sp_array_value( $performance_ids, $key, null ); $icons = ''; if ( $performance_id && has_post_thumbnail( $performance_id ) ): $icons = str_repeat( get_the_post_thumbnail( $performance_id, 'sportspress-fit-mini', array( 'title' => sp_get_singular_name( $performance_id ) ) ) . ' ', $value ); endif; - echo apply_filters( 'sportspress_event_performance_icons', $icons, $performance_id, $value ); + $content .= apply_filters( 'sportspress_event_performance_icons', $icons, $performance_id, $value ); endif; endforeach; - - if ( $mode == 'icons' ) echo ''; + + if ( isset( $position ) && $mode == 'icons' ): + $name .= ' ' . $position . ''; + endif; + + echo '' . $name . ''; + + if ( $mode == 'icons' ): + echo '' . $content . ''; + else: + echo $content; + endif; echo '';