Skip to content
This repository was archived by the owner on Oct 6, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions includes/class-staff.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function __construct( $post_id ) {
$this->ID = $post->ID;
$this->name = $post->post_title;
$this->title = get_post_meta( $post_id, 'staffer_staff_title', true );
$this->bio = esc_attr( $post->post_content );
$this->bio = apply_filters( 'the_content', $post->post_content );
$this->departments = wp_get_post_terms( $post_id, 'department' );
$excerpt = $post->post_excerpt;
$this->excerpt = empty( $excerpt ) ? wp_trim_words( $post->post_content, 55 ) : $excerpt;
Expand All @@ -58,4 +58,4 @@ public function __construct( $post_id ) {
$this->youtube = get_post_meta( $post_id, 'staffer_staff_youtube', true );
$this->github = get_post_meta( $post_id, 'staffer_staff_github', true );
}
}
}
68 changes: 37 additions & 31 deletions includes/class-staffer.php
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ public function create_staff_page() {
* @since 2.0.0
* @return string Markup for Staffer output
*/

public function build_staff_page() {
//ob_start();

Expand Down Expand Up @@ -364,7 +364,33 @@ public function build_staff_page() {

$output .= '<div class="staff-content cw-staffer-clearfix">';

$output .= '<a data-bio="' . esc_attr( wpautop( do_shortcode($staff_obj->bio ) ) ) . '"
$output .= '<a
data-name="' . $staff_obj->name . '"
data-departments="' . $departments_string . '"
data-image="' . esc_attr( $thumbnail ) . '"
data-large-image="' . esc_attr( $large ) . '"
data-phone="' . $staff_obj->phone . '"
data-email="' . $staff_obj->email . '"
data-facebook="' . $staff_obj->facebook . '"
data-twitter="' . $staff_obj->twitter . '"
data-linkedin="' . $staff_obj->linkedin . '"
data-youtube="' . $staff_obj->youtube . '"
data-instagram="' . $staff_obj->instagram . '"
data-github="' . $staff_obj->github . '"
data-google-plus="' . $staff_obj->google_plus . '"
data-website="' . $staff_obj->website . '"
data-title="' . $staff_obj->title . '"
data-staff-slug="' . $staff->post_name. '"
data-staff-id="' . $staff_obj->ID . '"
class="cw-launch-staffer-modal" href="/">' . $thumbnail . '</a>';

if( $options['layout'] == 'grid' ) {
$output .= '</div>';
$output .= '<header class="staffer-staff-header">';
}

$output .= '<h3 class="staffer-staff-title">
<a
data-name="' . $staff_obj->name . '"
data-departments="' . $departments_string . '"
data-image="' . esc_attr( $thumbnail ) . '"
Expand All @@ -382,35 +408,9 @@ public function build_staff_page() {
data-title="' . $staff_obj->title . '"
data-staff-slug="' . $staff->post_name. '"
data-staff-id="' . $staff_obj->ID . '"
class="cw-launch-staffer-modal" href="/">' . $thumbnail . '</a>';

if( $options['layout'] == 'grid' ) {
$output .= '</div>';
$output .= '<header class="staffer-staff-header">';
}

$output .= '<h3 class="staffer-staff-title">
<a data-bio="' . esc_attr( wpautop( do_shortcode($staff_obj->bio ) ) ) . '"
data-name="' . $staff_obj->name . '"
data-departments="' . $departments_string . '"
data-image="' . esc_attr( $thumbnail ) . '"
data-large-image="' . esc_attr( $large ) . '"
data-phone="' . $staff_obj->phone . '"
data-email="' . $staff_obj->email . '"
data-facebook="' . $staff_obj->facebook . '"
data-twitter="' . $staff_obj->twitter . '"
data-linkedin="' . $staff_obj->linkedin . '"
data-youtube="' . $staff_obj->youtube . '"
data-instagram="' . $staff_obj->instagram . '"
data-github="' . $staff_obj->github . '"
data-google-plus="' . $staff_obj->google_plus . '"
data-website="' . $staff_obj->website . '"
data-title="' . $staff_obj->title . '"
data-staff-slug="' . $staff->post_name. '"
data-staff-id="' . $staff_obj->ID . '"
class="cw-launch-staffer-modal" href="/">
' . $staff_obj->name . '</a>
</h3>';
class="cw-launch-staffer-modal" href="/">
' . $staff_obj->name . '</a>
</h3>';

if( $staff_obj->title ) {
$output .= '<small class="staffer-staff-title"><em>' . $staff_obj->title . '</em></small>';
Expand All @@ -428,6 +428,12 @@ class="cw-launch-staffer-modal" href="/">
$output .= '<small class="staffer-staff-email"><em></em></small>';
}

$output .= '<div class="vtest"></div>';

if( $staff_obj->bio ) {
$output .= '<article class="staffer-staff-bio">' . $staff_obj->bio . '</article>';
}

if( $options['layout'] == 'list' ) {
$output .= $social_output;
//$output .= '<div class="staff-bio">' . wpautop( $staff_obj->excerpt ) . '</div>';
Expand Down
92 changes: 48 additions & 44 deletions public/class-staffer-public.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public function register_post_types() {
*
* @since 1.0.0
*/

public function register_taxonomies() {

$staffer = new Staffer();
Expand All @@ -144,7 +144,7 @@ public function register_taxonomies() {
*
* @since 2.0.0
*/

public function staffer_thumbnail_check() {

if ( !current_theme_supports ('post-thumbnails') ) {
Expand Down Expand Up @@ -280,53 +280,53 @@ public function staffer_shortcode( $atts ) {

echo '<div class="staff-content cw-staffer-clearfix">';

echo '<a data-bio="' . esc_attr( wpautop( do_shortcode($staff_obj->bio ) ) ) . '"
data-name="' . $staff_obj->name . '"
data-departments="' . $departments_string . '"
data-image="' . esc_attr( $thumbnail ) . '"
data-large-image="' . esc_attr( $large ) . '"
data-phone="' . $staff_obj->phone . '"
data-email="' . $staff_obj->email . '"
data-facebook="' . $staff_obj->facebook . '"
data-twitter="' . $staff_obj->twitter . '"
data-linkedin="' . $staff_obj->linkedin . '"
data-youtube="' . $staff_obj->youtube . '"
data-instagram="' . $staff_obj->instagram . '"
data-github="' . $staff_obj->github . '"
data-google-plus="' . $staff_obj->google_plus . '"
data-website="' . $staff_obj->website . '"
data-title="' . $staff_obj->title . '"
data-staff-slug="' . $staff->post_name. '"
data-staff-id="' . $staff_obj->ID . '"
class="cw-launch-staffer-modal" href="/">' . $thumbnail . '</a>';
echo '<a
data-name="' . esc_attr( $staff_obj->name ) . '"
data-departments="' . $departments_string . '"
data-image="' . esc_attr( $thumbnail ) . '"
data-large-image="' . esc_attr( $large ) . '"
data-phone="' . $staff_obj->phone . '"
data-email="' . $staff_obj->email . '"
data-facebook="' . $staff_obj->facebook . '"
data-twitter="' . $staff_obj->twitter . '"
data-linkedin="' . $staff_obj->linkedin . '"
data-youtube="' . $staff_obj->youtube . '"
data-instagram="' . $staff_obj->instagram . '"
data-github="' . $staff_obj->github . '"
data-google-plus="' . $staff_obj->google_plus . '"
data-website="' . $staff_obj->website . '"
data-title="' . $staff_obj->title . '"
data-staff-slug="' . $staff->post_name. '"
data-staff-id="' . $staff_obj->ID . '"
class="cw-launch-staffer-modal" href="?uid=' . $staff->post_name . '">' . $thumbnail . '</a>';

if( $options['layout'] == 'grid' ) {
echo '</div>';
echo '<header class="staffer-staff-header">';
}

echo '<h3 class="staffer-staff-title">
<a data-bio="' . esc_attr( wpautop( do_shortcode($staff_obj->bio ) ) ) . '"
data-name="' . $staff_obj->name . '"
data-departments="' . $departments_string . '"
data-image="' . esc_attr( $thumbnail ) . '"
data-large-image="' . esc_attr( $large ) . '"
data-phone="' . $staff_obj->phone . '"
data-email="' . $staff_obj->email . '"
data-facebook="' . $staff_obj->facebook . '"
data-twitter="' . $staff_obj->twitter . '"
data-linkedin="' . $staff_obj->linkedin . '"
data-youtube="' . $staff_obj->youtube . '"
data-instagram="' . $staff_obj->instagram . '"
data-github="' . $staff_obj->github . '"
data-google-plus="' . $staff_obj->google_plus . '"
data-website="' . $staff_obj->website . '"
data-title="' . $staff_obj->title . '"
data-staff-slug="' . $staff->post_name. '"
data-staff-id="' . $staff_obj->ID . '"
class="cw-launch-staffer-modal" href="/">
' . $staff_obj->name . '</a>
</h3>';
<a
data-name="' . esc_attr( $staff_obj->name ) . '"
data-departments="' . $departments_string . '"
data-image="' . esc_attr( $thumbnail ) . '"
data-large-image="' . esc_attr( $large ) . '"
data-phone="' . $staff_obj->phone . '"
data-email="' . $staff_obj->email . '"
data-facebook="' . $staff_obj->facebook . '"
data-twitter="' . $staff_obj->twitter . '"
data-linkedin="' . $staff_obj->linkedin . '"
data-youtube="' . $staff_obj->youtube . '"
data-instagram="' . $staff_obj->instagram . '"
data-github="' . $staff_obj->github . '"
data-google-plus="' . $staff_obj->google_plus . '"
data-website="' . $staff_obj->website . '"
data-title="' . $staff_obj->title . '"
data-staff-slug="' . $staff->post_name. '"
data-staff-id="' . $staff_obj->ID . '"
class="cw-launch-staffer-modal" href="?uid=' . $staff->post_name . '">
' . $staff_obj->name . '</a>
</h3>';

if( $staff_obj->title ) {
echo '<small class="staffer-staff-title"><em>' . $staff_obj->title . '</em></small>';
Expand All @@ -344,6 +344,10 @@ class="cw-launch-staffer-modal" href="/">
echo '<small class="staffer-staff-email"><em></em></small>';
}

if( $staff_obj->bio ) {
echo '<article class="staffer-staff-bio">' . $staff_obj->bio . '</article>';
}

if( $options['layout'] == 'list' ) {
echo $social_output;
}
Expand Down Expand Up @@ -430,7 +434,7 @@ public function staffer_body_class( $classes ) {
$classes[] = 'staffer-main-page';
}

return $classes;
return $classes;
}

}
6 changes: 5 additions & 1 deletion public/css/sass/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ ul.staffer-archive-list {
box-shadow: none!important;
}

.staff-li .staffer-staff-bio {
display: none;
}

ul.staffer-archive-grid h3.staffer-staff-title,
ul.staffer-archive-list h3.staffer-staff-title {
font-size: initial!important;
Expand Down Expand Up @@ -210,4 +214,4 @@ body.cw-staffer-overlay:before {
top: 0;
left: 0;
background: rgba(0,0,0,0.80);
}
}
2 changes: 1 addition & 1 deletion public/css/staffer-styles.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading