Display league tables on team pages close #44
This commit is contained in:
30
templates/team-tables.php
Normal file
30
templates/team-tables.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
/**
|
||||
* Team League Tables
|
||||
*
|
||||
* @author ThemeBoy
|
||||
* @package SportsPress/Templates
|
||||
* @version 1.3
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
if ( ! isset( $id ) )
|
||||
$id = get_the_ID();
|
||||
|
||||
$team = new SP_Team( $id );
|
||||
$tables = $team->tables();
|
||||
|
||||
foreach ( $tables as $table ):
|
||||
if ( ! $table ) continue;
|
||||
|
||||
if ( sizeof( $tables ) > 1 ):
|
||||
?>
|
||||
<h4 class="sp-table-caption"><?php echo $table->post_title; ?></h4>
|
||||
<?php
|
||||
endif;
|
||||
|
||||
sp_get_template( 'league-table.php', array( 'id' => $table->ID, 'highlight' => $id ) );
|
||||
endforeach;
|
||||
?>
|
||||
<br>
|
||||
Reference in New Issue
Block a user