Dropdown nav images use new small size instead of 'large'
authorLaury GvR <laury@gaslightmedia.com>
Tue, 5 Dec 2017 20:12:13 +0000 (15:12 -0500)
committerLaury GvR <laury@gaslightmedia.com>
Tue, 5 Dec 2017 20:12:13 +0000 (15:12 -0500)
functions.php
lib/menu-walker.php

index c696edd..a953198 100644 (file)
@@ -217,6 +217,7 @@ function is_post_type($type){
 add_action('thematic_searchloop', 'mytheme_search_loop');
 // End of the Contextual/Highlight Search functions
 add_image_size('glm_blocks', '538', '660', true);
+add_image_size('nav_dropdown', '225', '133', true);
 add_image_size('glm_blocks_small', '570', '315', array( 'center', 'bottom' ));
 
 add_action( 'wp', 'post_pw_sess_expire' );
index ecdca46..dc90eab 100644 (file)
@@ -24,8 +24,7 @@ class Glm_Theme_Top_Bar_Walker extends Walker_Nav_Menu {
         $item_style = '';
 //        echo "<pre>", print_r($object), "</pre>";
         if ( $depth !== 0 && has_post_thumbnail( (int)$object->object_id ) ) {
-             $thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( (int)$object->object_id ), 'large' );
-
+            $thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( (int)$object->object_id ), 'nav_dropdown' );
             $item_style .= "<style>
             #menu-item-".$object->ID.":before {
             display: inline-block;
@@ -41,7 +40,6 @@ class Glm_Theme_Top_Bar_Walker extends Walker_Nav_Menu {
             </style>";
 
         } else if( $depth !== 0 && ! has_post_thumbnail( (int)$object->object_id ) ){
-
             $thumbnail = get_template_directory_uri() . '/assets/nav-images/snow-cams-image.jpg';
             $item_style .= "<style>
             #menu-item-".$object->ID.":before {