Change featured image for post pages
authorLaury GvR <laury@gaslightmedia.com>
Mon, 13 Nov 2017 19:20:42 +0000 (14:20 -0500)
committerLaury GvR <laury@gaslightmedia.com>
Mon, 13 Nov 2017 19:20:42 +0000 (14:20 -0500)
assets/blog-featured.jpg [new file with mode: 0644]
functions.php

diff --git a/assets/blog-featured.jpg b/assets/blog-featured.jpg
new file mode 100644 (file)
index 0000000..001ba5e
Binary files /dev/null and b/assets/blog-featured.jpg differ
index b4fd8fa..694da8a 100644 (file)
@@ -109,6 +109,8 @@ 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].');height:300px;padding:0;padding-bottom:300px;background-position:center center;background-size: 100% 100%;background-repeat:no-repeat;max-height: 300px; "';
+    } else if (is_post()) {
+            echo ' style="background-image: url('.get_template_directory_uri().'/assets/blog-featured.jpg);height:300px;padding:0;padding-bottom:300px;background-position:center center;background-size: cover;background-repeat:no-repeat;max-height: 300px;"';
     } else {
             echo ' style="background-image: url('.get_template_directory_uri().'/assets/stay.jpg);height:300px;padding:0;padding-bottom:300px;background-position:center center;background-size: cover;background-repeat:no-repeat;max-height: 300px;"';
             echo ' class="no-featured"';