Home Forums WoodMart support forum Mobile Logo size

Mobile Logo size

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #110542

    craigdutton
    Participant

    I 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>
    #110597

    Hello,

    Please add this code to the Theme Settings > Custom CSS > Mobile:

    body .whb-general-header .woodmart-logo img {
        max-width: 250px;
    }

    Best Regards

    #110613

    craigdutton
    Participant

    Thank you so much for the reply, it works perfectly.

    Regards

    Craig

    #110629

    You are welcome! If you have any questions please feel free to contact us.

    Best Regards

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Mobile Logo size’ is closed to new replies.