Fixed the default featured image; code ensures post has thumbnail before using it
authorLaury GvR <laury@gaslightmedia.com>
Mon, 22 Jan 2018 22:01:41 +0000 (17:01 -0500)
committerLaury GvR <laury@gaslightmedia.com>
Mon, 22 Jan 2018 22:01:41 +0000 (17:01 -0500)
assets/default-featured.jpg
functions.php

index cdef331..d7e89f6 100644 (file)
Binary files a/assets/default-featured.jpg and b/assets/default-featured.jpg differ
index f19edcb..f69de83 100644 (file)
@@ -102,7 +102,7 @@ function glm_get_header() {
     }
 
     echo '<div class="header-image-background"';
-    if ( is_post_type('page') ) {
+    if ( is_post_type('page') && has_post_thumbnail() ) {
         $image_data = wp_get_attachment_image_src(get_post_thumbnail_id($post_id), "full");
         echo ' style="background-image: url('.$image_data[0].');padding:0;padding-bottom:16%;background-position:center bottom;background-size: cover;background-repeat:no-repeat;max-height: 350px;max-width: 1200px;margin: 0 auto; "';