Fix - Include staff name and profile in [staff] shortcode

This commit is contained in:
Paresh Radadiya
2018-01-13 08:38:20 +05:30
parent 6b25ccaca3
commit e511c6e177
5 changed files with 80 additions and 2 deletions

View File

@@ -0,0 +1,28 @@
<?php
/**
* Staff Header
*
* @author ThemeBoy
* @package SportsPress/Templates
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
if ( ! isset( $id ) )
$id = get_the_ID();
$post = get_post( $id );
$title = $post->post_title;
if ( $title ) {
$staff = new SP_Staff( $id );
$role = $staff->role();
if ( $role )
$title = '<strong class="sp-staff-role">' . $role->name . '</strong> ' . $title;
?>
<div class="sp-template sp-template-staff-header sp-template-header">
<h3 class="sp-item-title"><?php echo $title ?></h3>
</div>
<?php
}