So my solution:
1. Disable Players Lists. Don’t need this.
2. Import all your players on the appropriate teams
3. I turned players-list.php into a shortcode
a. Changed all the defaults to values that I wanted (took all the get_options out and replaced them with appropriate values)
$defaults = array(
'id' => get_the_ID(),
'title' => 'Players',
'number' => -1,
'grouptag' => 'h4',
'columns' => null,
'grouping' => null,
'orderby' => 'default',
'order' => 'ASC',
'show_all_players_link' => false,
'show_title' => true,
'show_player_photo' => false,
'show_player_flag' => true,
'link_posts' => false,
'link_teams' => true,
'abbreviate_teams' => true,
'sortable' => true,
'scrollable' => true,
'paginated' => true,
'rows' => get_option( 'sportspress_list_rows', 10 ),
);</blockquote>
b. Added positions to my labels: ( insert this code under $labels = $data[0];
)
$labels['position'] = 'Positions';
c. Go to the bottom where they start filling up $output. Right under where they end the </thead>
, change the way the <tbody>
is built like this:
$output .= '</tr>' . '</thead>';
if(get_post_meta($player_id, 'sp_current_team', true) != $id) {
$tbody = "";
}
$output .= '<tbody>' . $tbody . '</tbody>';
$output .= '</table>' . '</div>';
This code essentially sees if the current post ($id is the current post id, I use the shortcode only on team pages) is a team that player belongs to and then includes the player in the table if they are. If you want to display all teams, take out that if statement. You could also add a variable to the shortcode if you wanted to set which team of players should be displayed in your shortcode in the WordPress admin on a post or page. Let me know if you have any questions.