';
+ $gallery = '';
if ( ! empty( $group->name ) ):
- echo '
';
- echo '<' . $grouptag . ' class="player-group-name player-gallery-group-name">' . $group->name . '' . $grouptag . '>';
+ $gallery .= '
';
+ $gallery .= '<' . $grouptag . ' class="player-group-name player-gallery-group-name">' . $group->name . '' . $grouptag . '>';
endif;
foreach( $data as $player_id => $performance ): if ( empty( $group->term_id ) || has_term( $group->term_id, 'sp_position', $player_id ) ):
@@ -142,6 +140,8 @@ echo apply_filters( 'gallery_style', $gallery_style . "\n\t\t" );
$caption = get_the_title( $player_id );
$caption = trim( $caption );
+ ob_start();
+
sp_get_template( 'player-gallery-thumbnail.php', array(
'id' => $player_id,
'itemtag' => $itemtag,
@@ -152,11 +152,21 @@ echo apply_filters( 'gallery_style', $gallery_style . "\n\t\t" );
'link_posts' => $link_posts,
) );
+ $gallery .= ob_get_clean();
+
$i++;
endif; endforeach;
$j++;
+
+ if ( $i === 0 ) continue;
+
+ echo '
';
+
+ echo '
';
+
+ echo $gallery;
if ( ! $html5 && $columns > 0 && ++$i % $columns == 0 ) {
echo '
';
diff --git a/templates/player-list.php b/templates/player-list.php
index 1ed4e0f8..ef1a5eeb 100644
--- a/templates/player-list.php
+++ b/templates/player-list.php
@@ -98,36 +98,12 @@ else:
endif;
foreach ( $groups as $group ):
-
- $output .= '
';
-
- if ( ! empty( $group->name ) ):
- $output .= '
';
- $output .= '<' . $grouptag . ' class="sp-table-caption player-group-name player-list-group-name">' . $group->name . '' . $grouptag . '>';
- endif;
-
- $output .= '