/* Header for posts*/
function glm_get_header($memberID = false) {
global $post;
-
+ $default_image_path = get_template_directory_uri().'/assets/default-header.png';
+ $default_member_image_path = $default_image_path;
+ $featured_classes[] = "featured-image";
if ((has_post_thumbnail() && $post->post_type == 'page') || is_page('member-detail')) {
- if(!$memberID){
+ if( !$memberID ) {
$image_data = wp_get_attachment_image_src(get_post_thumbnail_id(), "full");
$image_caption = get_the_post_thumbnail_caption();
$image_data = $image_data[0];
+ $featured_classes[] = $image_data ? "wp-featured" : "";
} else {
$image_data = apply_filters('member_images',$memberID,true,'original');
+ $featured_classes[] = $image_data ? "member-featured" : "";
+ if ( !$image_data ) {
+ $image_data = wp_get_attachment_image_src(get_post_thumbnail_id(), "full");
+ $image_caption = get_the_post_thumbnail_caption();
+ $image_data = $image_data[0];
+ $featured_classes[] = $image_data ? "wp-featured" : "";
+ }
+ if ( !$image_data ) {
+ $image_data = $default_member_image_path;
+ $featured_classes[] = $image_data ? "member-default" : "";
+ }
}
+ if ( !$image_data ) {
+ $image_data = $default_image_path;
+ $featured_classes[] = $image_data ? "interior-default" : "";
+ }
+
echo '<div style="background-image: url('.$image_data.');height:0;padding:0;padding-bottom:50%;'
- . 'background-position:center center;background-size: cover;background-repeat:no-repeat;max-height: 600px; "';
+ . 'background-position:center center;background-size: cover;background-repeat:no-repeat;max-height: 600px; "'
+ . 'class="' . implode(' ',$featured_classes) . '"';
echo '>';
if ($image_caption) {
echo '</div>';
echo '</div>';
}
- } else if (!is_page('member-detail')) {
+ } else {
+ $featured_classes[] = "interior-default";
echo '<div';
echo ' style="background-image: url('.get_template_directory_uri().'/assets/default-header.png);height:0;padding:0;padding-bottom:50%;'
- . 'background-position:center center;background-size: cover;background-repeat:no-repeat;max-height: 600px; "';
+ . 'background-position:center center;background-size: cover;background-repeat:no-repeat;max-height: 600px; "'
+ . 'class="' . implode(' ',$featured_classes) . '"';
echo '>';
- } else {
- echo '<div>';
}
echo '</div>';
- echo '<div class="row">';
- echo '<div class="small-12 columns">';
- echo '</div>';
- echo '</div>';
}
if (!function_exists('write_log')) {
function write_log ( $log ) {