changing default header image for package details
authorAnthony Talarico <talarico@gaslightmedia.com>
Fri, 2 Feb 2018 16:04:11 +0000 (11:04 -0500)
committerAnthony Talarico <talarico@gaslightmedia.com>
Fri, 2 Feb 2018 16:04:11 +0000 (11:04 -0500)
changing default featured image for the package detail pages

assets/package_default.jpg [new file with mode: 0644]
functions.php
parts/header-meta.php
style.css

diff --git a/assets/package_default.jpg b/assets/package_default.jpg
new file mode 100644 (file)
index 0000000..a4e6c0a
Binary files /dev/null and b/assets/package_default.jpg differ
index 45d822c..0741882 100644 (file)
@@ -76,17 +76,20 @@ function glm_site_scripts()
 
 }
 
-
 /* Header for posts*/
 function glm_get_header() {
-    echo '<div';
     global $post;
+
+    echo '<div';
     if (has_post_thumbnail() && $post->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; "';
+        $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; "';
+    } else if($post->post_type == 'troutcreek_package') {
+        echo ' style="background-image: url('.get_template_directory_uri().'/assets/package_default.jpg);height:0;padding:0;padding-bottom:20%;background-position:center center;background-size: 100%;background-repeat:no-repeat;max-height: 300px;"';
+        echo ' class="no-featured"';
     } else {
-            echo ' style="background-image: url('.get_template_directory_uri().'/assets/lobby.jpg);height:0;padding:0;padding-bottom:20%;background-position:center center;background-size: 100%;background-repeat:no-repeat;max-height: 300px;"';
-            echo ' class="no-featured"';
+        echo ' style="background-image: url('.get_template_directory_uri().'/assets/lobby.jpg);height:0;padding:0;padding-bottom:20%;background-position:center center;background-size: 100%;background-repeat:no-repeat;max-height: 300px;"';
+        echo ' class="no-featured"';
     }
     echo '>';
     echo '</div>';
index 39080bc..b6b39b5 100644 (file)
@@ -2,6 +2,6 @@
     <meta charset="utf-8" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
     <title><?php wp_title(); ?></title>
-    <link rel="stylesheet" href="<?php echo get_stylesheet_directory_uri() ; ?>/css/app.css?v=1.0.11">
+    <link rel="stylesheet" href="<?php echo get_stylesheet_directory_uri() ; ?>/css/app.css?v=1.0.12">
     <?php wp_head(); ?>
   </head>
\ No newline at end of file
index 0b76546..4d4bcce 100644 (file)
--- a/style.css
+++ b/style.css
@@ -3,5 +3,5 @@ Theme Name: TroutCreek
 Author: Gaslight Media
 Author URI: http://www.gaslightmedia.com
 Description: A theme for TroutCreek
-Version: 1.0.11
+Version: 1.0.12
 */