Add ability to display staff members in team page

This commit is contained in:
Brian Miyaji
2015-12-29 15:49:01 +11:00
parent 16b8e17c11
commit 331634a65f
6 changed files with 204 additions and 0 deletions

32
templates/team-staff.php Normal file
View File

@@ -0,0 +1,32 @@
<?php
/**
* Team Staff
*
* @author ThemeBoy
* @package SportsPress/Templates
* @version 1.9.12
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
if ( ! isset( $id ) )
$id = get_the_ID();
$team = new SP_Team( $id );
$members = $team->staff();
foreach ( $members as $staff ):
$id = $staff->ID;
$name = $staff->post_title;
$staff = new SP_Staff( $id );
$role = $staff->role();
if ( $role )
$name = '<span class="sp-staff-role">' . $role->name . '</span> ' . $name;
?>
<h4 class="sp-staff-name"><?php echo $name; ?></h4>
<?php
sp_get_template( 'staff-photo.php', array( 'id' => $id ) );
sp_get_template( 'staff-details.php', array( 'id' => $id ) );
endforeach;