Home Forums WoodMart support forum Image zoom Reply To: Image zoom

#39407

Artem Temos
Keymaster

The function should look like this

function woodmart_header_block_logo() {

	$header_color_scheme = woodmart_get_opt( 'header_color_scheme' );

	// Get the logo
	$logo 		= WOODMART_IMAGES . '/wood-logo-dark.svg';
	$logo_white = WOODMART_IMAGES . '/wood-logo-white.svg';

	$protocol = woodmart_http() . "://";

	$logo_uploaded = woodmart_get_opt('logo');
	$logo_white_uploaded = woodmart_get_opt('logo-white');
	$logo_sticky_uploaded = woodmart_get_opt('logo-sticky');
	$has_sticky_logo = ( isset( $logo_sticky_uploaded['url'] ) && ! empty( $logo_sticky_uploaded['url'] ) );

	if(isset($logo_white_uploaded['url']) && $logo_white_uploaded['url'] != '') {
		$logo_white = $logo_white_uploaded['url'];
	}
	if(isset($logo_uploaded['url']) && $logo_uploaded['url'] != '') {
		$logo = $logo_uploaded['url'];
	}

	if( $header_color_scheme == 'light' ) {
		$logo = $logo_white;
	}

	$logo = $protocol. str_replace(array('http://', 'https://'), '', $logo);

	?>
		<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="190" height="70" />'; ?>
				</a>
				<?php if ( $has_sticky_logo ): ?>
					<?php 
						$logo_sticky = $protocol . str_replace( array( 'http://', 'https://' ), '', $logo_sticky_uploaded['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' ) . '" />'; ?>
					</a>
				<?php endif ?>
			</div>
		</div>
	<?php
}