Update the get header function
authorSteve Sutton <steve@gaslightmedia.com>
Wed, 30 Dec 2015 20:03:05 +0000 (15:03 -0500)
committerSteve Sutton <steve@gaslightmedia.com>
Wed, 30 Dec 2015 20:03:05 +0000 (15:03 -0500)
put back the featured images on the page post_type

functions.php

index 24e7243..dda79f8 100644 (file)
@@ -99,13 +99,13 @@ function glm_site_scripts()
 /* Header for posts*/
 function glm_get_header() {
     echo '<div';
+    if ( get_post_type( get_the_ID() ) == 'page' && has_post_thumbnail() ) {
+        $image_data = wp_get_attachment_image_src(get_post_thumbnail_id(), "full");
+        echo ' id="feature-image" style="background-image: url('.$image_data[0].');height:100%;padding:0;background-position:top center;background-size:cover;background-repeat:no-repeat;min-height: 270px;max-height: 630px;"';
 
-    //if (has_post_thumbnail()) {
-          //  $image_data = wp_get_attachment_image_src(get_post_thumbnail_id(), "full");
-           // echo ' id="feature-image" style="background-image: url('.$image_data[0].');height:100%;padding:0;background-position:top center;background-size:cover;background-repeat:no-repeat;min-height: 270px;max-height: 630px;"';
-   // } else {
-            echo ' id="feature-image" style="background-image: url('.get_template_directory_uri().'/assets/slide-6.jpg);height:100%;padding:0;background-position:top center;background-size:cover;background-repeat:no-repeat;min-height: 270px;max-height: 630px;"';
-
+    } else {
+        echo ' id="feature-image" style="background-image: url('.get_template_directory_uri().'/assets/slide-6.jpg);height:100%;padding:0;background-position:top center;background-size:cover;background-repeat:no-repeat;min-height: 270px;max-height: 630px;"';
+    }
     echo '>';
     echo '</div>';
     echo '<div class="row">';