From: Laury GvR Date: Mon, 8 Jan 2018 19:16:16 +0000 (-0500) Subject: Member detail pages now show featured images again X-Git-Tag: v1.0.0^2~12 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=0ab82c03ae4c09b83d463a30f73b198cb2b20b9f;p=WP-Themes%2Fvisitescanaba.git Member detail pages now show featured images again glm_get_header was echoing the array size whenever the image data returned from glm_get_header was an array instead of an image. This resulted in the featured image for certain members to have that number as the source, and for no image to be shown. --- diff --git a/functions.php b/functions.php index aa2c5d5..915da44 100644 --- a/functions.php +++ b/functions.php @@ -83,16 +83,19 @@ function glm_get_header($memberID = false) { $bur = "a"; } else { $image_data = apply_filters('member_images',$memberID,true,'original'); + if ( is_array($image_data) ) { + $image_data = $image_data[0]; + } $bur = "b"; } if ($image_data) { - echo 'bur="'.$bur.'" style="background-image: url('.$image_data.');height:0;padding:0;padding-bottom:22%;background-position:center center;background-size: 100%;background-repeat:no-repeat;max-height: 420px; "'; + echo ' bur="'.$bur.'" style="background-image: url('.$image_data.');height:0;padding:0;padding-bottom:22%;background-position:center center;background-size: 100%;background-repeat:no-repeat;max-height: 420px; "'; } else { - echo 'bur="'.$bur.'" style="background-image: url('.get_template_directory_uri().'/assets/default.jpg);height:0;padding:0;padding-bottom:22%;background-position:center center;background-size: 100%;background-repeat:no-repeat;max-height: 420px; "'; + echo ' bur="'.$bur.'" style="background-image: url('.get_template_directory_uri().'/assets/default.jpg);height:0;padding:0;padding-bottom:22%;background-position:center center;background-size: 100%;background-repeat:no-repeat;max-height: 420px; "'; } } else if (!is_page('member-detail')) { $bur = "c"; - echo 'bur="'.$bur.'" style="background-image: url('.get_template_directory_uri().'/assets/default.jpg);height:0;padding:0;padding-bottom:22%;background-position:center center;background-size: 100%;background-repeat:no-repeat;max-height: 420px; "'; + echo ' bur="'.$bur.'" style="background-image: url('.get_template_directory_uri().'/assets/default.jpg);height:0;padding:0;padding-bottom:22%;background-position:center center;background-size: 100%;background-repeat:no-repeat;max-height: 420px; "'; } echo '>'; echo '';