fixing header images from getting crunched
authorAnthony Talarico <talarico@gaslightmedia.com>
Tue, 10 Apr 2018 19:12:57 +0000 (15:12 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Tue, 10 Apr 2018 19:12:57 +0000 (15:12 -0400)
header interior images are getting distorted when changing viewports

functions.php

index f894de7..2721952 100644 (file)
@@ -101,7 +101,7 @@ function glm_get_header() {
 
     if (has_post_thumbnail()  && (!(is_home()) ) && (!(is_single())) && (!(is_archive())) && (!(is_search()))) {
             $image_data = wp_get_attachment_image_src(get_post_thumbnail_id(), "full");
-            echo ' style="background-image: url('.$image_data[0].');padding:0;padding-bottom:400px;background-position:center center;background-size: 100% 100%;background-repeat:no-repeat;max-height: 400px; "';
+            echo ' style="background-image: url('.$image_data[0].');height:0;padding:0;padding-bottom:20%;background-position:center center;background-size: cover;background-repeat:no-repeat;max-height: 420px;min-height: 150px; "';
     } else if ( is_post_type( 'post' ) ) {
             echo ' style="background-image: url('.get_template_directory_uri().'/assets/blog-featured.jpg);height:400px;padding:0;padding-bottom:400px;background-position:center center;background-size: cover;background-repeat:no-repeat;max-height: 400px;"';
     } else {