Add ability to display staff members in team page
This commit is contained in:
32
templates/team-staff.php
Normal file
32
templates/team-staff.php
Normal 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;
|
||||
Reference in New Issue
Block a user