fixing default posts image
authorAnthony Talarico <talarico@gaslightmedia.com>
Fri, 16 Mar 2018 20:03:08 +0000 (16:03 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Fri, 16 Mar 2018 20:03:08 +0000 (16:03 -0400)
fixing default post image size

functions.php
inc/hero-header-news-single.php
style.css

index 2a7c834..e692562 100644 (file)
@@ -264,8 +264,8 @@ function wmta_scripts() {
 
        wp_enqueue_script( 'wmta-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20130115', true );
 
-       wp_enqueue_script( 'glm-dev', get_template_directory_uri() . '/assets/javascript/glm-dev.js', array(), '1.0.15.0', true );
-       wp_enqueue_style( 'glm-style', get_template_directory_uri() . '/assets/stylesheets/glm-dev.css', false, "1.0.15" );
+       wp_enqueue_script( 'glm-dev', get_template_directory_uri() . '/assets/javascript/glm-dev.js', array(), '1.0.16.0', true );
+       wp_enqueue_style( 'glm-style', get_template_directory_uri() . '/assets/stylesheets/glm-dev.css', false, "1.0.16" );
 
        if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
                wp_enqueue_script( 'comment-reply' );
index 0dbfdf2..535bdd1 100644 (file)
@@ -1,14 +1,16 @@
 <div class="row">
 
        <!-- background-image way -->
-       <div class="hero-header"<?php
-       if (has_post_thumbnail( $post->ID ) ) {
-               $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' );
-               echo ' style="background-image: url('.$image[0].');"' ;
-       } else {
-               echo 'style="background-image: url('.esc_url(get_template_directory_uri()).'/assets/img/default-header-member.jpg)" alt="" >';
-
-       } ?>>
+    <?php
+        if (has_post_thumbnail( $post->ID ) ) { ?>
+            <div class="hero-header post-has-featured">
+                   <?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' );
+            echo '<img src="'.$image[0].'" alt="" >' ;
+        } else { ?>
+            <div class="hero-header post-no-featured">
+            <?php echo '<img src="'.esc_url(get_template_directory_uri()).'/assets/img/default-header-member.jpg" alt="" >';
+        }
+               ?>
 
        </div>
 
@@ -27,3 +29,8 @@
        -->
 
 </div>
+<style>
+    .post-no-featured{
+        height: auto !important;
+    }
+</style>
\ No newline at end of file
index 09d00c5..b99312e 100644 (file)
--- a/style.css
+++ b/style.css
@@ -4,7 +4,7 @@ Theme URI: http://underscores.me/
 Author: Underscores.me
 Author URI: http://underscores.me/
 Description: Description
-Version: 1.0.15
+Version: 1.0.16
 License: GNU General Public License v2 or later
 License URI: http://www.gnu.org/licenses/gpl-2.0.html
 Text Domain: wmta