Home › Forums › WoodMart support forum › Mobile Logo size
Mobile Logo size
- This topic has 3 replies, 2 voices, and was last updated 5 years, 9 months ago by Elise Noromit.
-
AuthorPosts
-
March 2, 2019 at 7:49 am #110542
craigduttonParticipantI needed to increase the size of my logo beyond the standard 500px and found some some code that you suggested for ticket #110261 that I placed in header-elements/logo.php in my child theme. (see below)
The code works well for the job intended but now the mobile logo is too big. It seems that the new code has over written the mobile logo.
Please could you advise how could make the mobile logo smaller.
The code I have used
<?php // Get the logo $logo = WOODMART_IMAGES . '/wood-logo-dark.svg'; $protocol = woodmart_http() . "://"; $has_sticky_logo = ( isset( $params['sticky_image']['url'] ) && ! empty( $params['sticky_image']['url'] ) ); if(isset($params['image']['url']) && $params['image']['url'] != '') { $logo = $params['image']['url']; } if(isset($params['image']['id']) && $params['image']['id'] != '') { $attachment = wp_get_attachment_image_src( $params['image']['id'], 'full' ); if( isset( $attachment[0] ) && ! empty( $attachment[0] ) ) $logo = $attachment[0]; } $logo = $protocol. str_replace(array('http://', 'https://'), '', $logo); $width = isset($params['width']) ? (int) $params['width'] : 150; $sticky_width = isset($params['sticky_width']) ? (int) $params['sticky_width'] : 150; ?> <div class="site-logo"> <div class="woodmart-logo-wrap<?php if( $has_sticky_logo ) echo " switch-logo-enable"; ?>"> <a href="<?php echo esc_url( home_url('/') ); ?>" class="woodmart-logo woodmart-main-logo" rel="home"> <?php echo '<img src="' . $logo . '" alt="' . get_bloginfo( 'name' ) . '" width="600" height="250" style="max-width: 600px ' . esc_attr( $width ) . 'px;" />'; ?> </a> <?php if ( $has_sticky_logo ): ?> <?php $logo_sticky = $protocol . str_replace( array( 'http://', 'https://' ), '', $params['sticky_image']['url'] ); ?> <a href="<?php echo esc_url( home_url( '/' ) ); ?>" class="woodmart-logo woodmart-sticky-logo" rel="home"> <?php echo '<img src="' . $logo_sticky . '" alt="' . get_bloginfo( 'name' ) . '" width="500" height="50" style="max-width: 500px' . esc_attr( $sticky_width ) . 'px;" />'; ?> </a> <?php endif ?> </div> </div>
March 2, 2019 at 4:42 pm #110597
Elise NoromitMemberHello,
Please add this code to the Theme Settings > Custom CSS > Mobile:
body .whb-general-header .woodmart-logo img { max-width: 250px; }
Best Regards
March 2, 2019 at 7:55 pm #110613
craigduttonParticipantThank you so much for the reply, it works perfectly.
Regards
Craig
March 2, 2019 at 10:01 pm #110629
Elise NoromitMemberYou are welcome! If you have any questions please feel free to contact us.
Best Regards
-
AuthorPosts
The topic ‘Mobile Logo size’ is closed to new replies.
- You must be logged in to create new topics. Login / Register