Setting a new slideshow image for the News page
authorLaury GvR <laury@gaslightmedia.com>
Fri, 3 Nov 2017 20:33:01 +0000 (16:33 -0400)
committerLaury GvR <laury@gaslightmedia.com>
Fri, 3 Nov 2017 20:33:01 +0000 (16:33 -0400)
assets/slideshow-exterior-night.png [new file with mode: 0644]
functions.php

diff --git a/assets/slideshow-exterior-night.png b/assets/slideshow-exterior-night.png
new file mode 100644 (file)
index 0000000..429a10a
Binary files /dev/null and b/assets/slideshow-exterior-night.png differ
index 02244e4..092ae11 100644 (file)
@@ -80,9 +80,12 @@ function glm_site_scripts()
 function glm_get_header() {
     echo '<div';
 
-    if ((has_post_thumbnail() && is_post_type('page')) || (has_post_thumbnail() && is_page('news'))) {
+    if (has_post_thumbnail() && is_post_type('page')) {
             $image_data = wp_get_attachment_image_src(get_post_thumbnail_id(), "full");
             echo ' style="background-image: url('.$image_data[0].');height:0;padding:0;padding-bottom:20%;background-position:center center;background-size: 100%;background-repeat:no-repeat;max-height: 300px;overflow-y: hidden; "';
+    } else if(is_home()) {
+            echo ' style="background-image: url('.get_template_directory_uri().'/assets/slideshow-exterior-night.png);height:0;padding:0;padding-bottom:20%;background-position:center center;background-size: 100%;background-repeat:no-repeat;max-height: 300px;overflow-y: hidden;"';
+            echo ' class="no-featured"';
     } else if(is_post_type('post') ){
             echo ' style="background-image: url('.get_template_directory_uri().'/assets/blog-default.png);height:0;padding:0;padding-bottom:20%;background-position:center center;background-size: 100%;background-repeat:no-repeat;max-height: 300px;overflow-y: hidden;"';
             echo ' class="no-featured"';