Tweak shortcode content markup to match post markup

This commit is contained in:
Brian Miyaji
2018-01-22 01:29:13 +11:00
parent 179c291b88
commit c0f9d1838e
3 changed files with 17 additions and 21 deletions

View File

@@ -9,20 +9,16 @@
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
if ( ! isset( $id ) )
$id = get_the_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
$staff = new SP_Staff( $id );
$role = $staff->role();
if ( $role )
$title = '<strong class="sp-staff-role">' . $role->name . '</strong> ' . $title;
?>
<h3 class="sp-staff-name"><?php echo $title ?></h3>
<?php
}