From b1771e5e5e4de68fefe2cb9817c5871723fab900 Mon Sep 17 00:00:00 2001 From: Brian Miyaji Date: Tue, 20 May 2014 08:59:08 +1000 Subject: [PATCH] Apply player gallery limit --- templates/player-gallery.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/templates/player-gallery.php b/templates/player-gallery.php index 9361d94a..7ff6b208 100644 --- a/templates/player-gallery.php +++ b/templates/player-gallery.php @@ -4,7 +4,7 @@ * * @author ThemeBoy * @package SportsPress/Templates - * @version 0.8 + * @version 0.9.4 */ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly @@ -115,6 +115,8 @@ foreach ( $groups as $group ): foreach( $data as $player_id => $performance ): if ( empty( $group->term_id ) || has_term( $group->term_id, 'sp_position', $player_id ) ): + if ( isset( $limit ) && $i >= $limit ) continue; + $caption = get_the_title( $player_id ); $caption = trim( $caption ); @@ -129,6 +131,8 @@ foreach ( $groups as $group ): 'link_posts' => $link_posts, ) ); + $i++; + endif; endforeach; echo '
';