Title: Custom list
Last modified: August 26, 2017

---

# Custom list

 *  [eatmailyo](https://wordpress.org/support/users/eatmailyo/)
 * (@eatmailyo)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/custom-list-2/)
 * Hello!
 * Im try to make a custom player list with PHP and I want to get all players from
   one team. But it doesn’t show any post, even not all players.
 * There’s the code:
 *     ```
       <?php 
       			$query = new WP_Query( array( 
       				'post_type' => 'sp_player',
       				'tax_query' => array(
       					array(
       						'taxonomy'  => 'sp_team',
       						'field'     => 'team',
       						'terms'     => 197,
       					)
       				),
       			) );                  
   
       			if ( $query->have_posts() ) : ?>
       				<?php while ( $query->have_posts() ) : $query->the_post(); 
   
       				$staff = new SP_Staff( $post->ID );
       				$current_teams = $staff->current_teams();
   
       				foreach ( $current_teams as $team ):
       					$team_name = sp_get_team_name( $team, $abbreviate_teams );
       					if ( $link_teams ) $team_name = '<a href="' . get_post_permalink( $team ) . '">' . $team_name . '</a>';
       					$teams[] = $team_name;
       				endforeach;
   
       			?>   
   
       					<?php the_title(); ?> ( <? echo $team_name; ?> ) - <?php the_date('d.m.Y', '', ''); ?>	<br/>
   
       				<?php endwhile; wp_reset_postdata(); ?>
       		<?php endif; ?>
       ```
   
 * For the plugin authors: I want to sort by age my list, that’s why Im making a
   custom list.

Viewing 1 replies (of 1 total)

 *  [Roch](https://wordpress.org/support/users/rochesterj/)
 * (@rochesterj)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/custom-list-2/#post-9447830)
 * Hi!
 * Thanks for your message!
 * Unfortunately we can’t provide support to custom code.
 * Thanks!
 * Kind Regards,
    -Roch

Viewing 1 replies (of 1 total)

The topic ‘Custom list’ is closed to new replies.

 * ![](https://ps.w.org/sportspress/assets/icon-256x256.png?rev=1252005)
 * [SportsPress - Sports Club & League Manager](https://wordpress.org/plugins/sportspress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/sportspress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/sportspress/)
 * [Active Topics](https://wordpress.org/support/plugin/sportspress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/sportspress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/sportspress/reviews/)

## Tags

 * [custom post type](https://wordpress.org/support/topic-tag/custom-post-type/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * 1 reply
 * 2 participants
 * Last reply from: [Roch](https://wordpress.org/support/users/rochesterj/)
 * Last activity: [8 years, 8 months ago](https://wordpress.org/support/topic/custom-list-2/#post-9447830)
 * Status: not resolved