From 66380d95f5a3b1d4279574fbe2405b1faed41652 Mon Sep 17 00:00:00 2001 From: Laury GvR Date: Tue, 5 Dec 2017 15:12:13 -0500 Subject: [PATCH] Dropdown nav images use new small size instead of 'large' --- functions.php | 1 + lib/menu-walker.php | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/functions.php b/functions.php index c696edd..a953198 100644 --- a/functions.php +++ b/functions.php @@ -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' ); diff --git a/lib/menu-walker.php b/lib/menu-walker.php index ecdca46..dc90eab 100644 --- a/lib/menu-walker.php +++ b/lib/menu-walker.php @@ -24,8 +24,7 @@ class Glm_Theme_Top_Bar_Walker extends Walker_Nav_Menu { $item_style = ''; // echo "
", print_r($object), "
"; 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 .= ""; } 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 .= "