New Landing How can we help? Themeforest Theme Support Neighborhood Different logo per language

Viewing 2 posts - 1 through 2 (of 2 total)
  • #219870
    PatrikCZ
    Member
    Post count: 51

    Hi guys

    We would like to have difference logo per each language.
    We found this manual – https://wpml.org/forums/topic/can-i-have-a-different-header-logo-image-for-each-language/
    So probably we should paste this code…

    <?php
    if (ICL_LANGUAGE_CODE == 'en') { ?>
     
    <img src="http://earlymusicbesalu.com/site/wp-content/themes/earlymusicbesalu/images/logo-eng-2012.png"/>
     
    <?php
    } else if (ICL_LANGUAGE_CODE == 'es') { ?>
    <img src="http://earlymusicbesalu.com/site/wp-content/themes/earlymusicbesalu/images/logo-es-2012.png" />
     
    <?php
    } else if (ICL_LANGUAGE_CODE == 'ca') {?>
    <img src="http://earlymusicbesalu.com/site/wp-content/themes/earlymusicbesalu/images/logo-ca-2012.png" />
     
    <?php
    } else if (ICL_LANGUAGE_CODE == 'fr') {
    ?>
    <img src="http://earlymusicbesalu.com/site/wp-content/themes/earlymusicbesalu/images/logo-fr-2012.png"/>
    <?php
    }
    ?>

    …somewhere to sf-header.php
    Unfortunately it is too difficult for us :/
    Please could you help us how to adjust the code?

    Thank you so much!

    Patrik

    #219934
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please paste this code at functions.php of child theme.

    function sf_logo($logo_class) {
    
    		//VARIABLES
    		global $woocommerce;
    		$options = get_option('sf_neighborhood_options');
    		$show_cart = $options['show_cart'];
    		$logo = $retina_logo = "";
    		if (isset($options['logo_upload'])) {
    		$logo = $options['logo_upload'];
    		}
    		if (isset($options['retina_logo_upload'])) {
    		$retina_logo = $options['retina_logo_upload'];
    		}
    		if ($logo == "") {
    		$logo = get_template_directory_uri() . '/images/logo.png';
    		}
    
    		if ($retina_logo == "") {
    		$retina_logo = $logo;
    		}
    		$logo_output = "";
    		$logo_alt = get_bloginfo( 'name' );
    		$logo_link_url = home_url();
    		$disable_search = false;
    		if (isset($options['disable_search'])) {
    			$disable_search = $options['disable_search'];
    		}
    
    		$logos = array('logo', 'retina_logo');
    		foreach ($logos as $this_logo) {
    			if (stripos(${$this_logo}, 'http://') === 0) {
    				${$this_logo} = substr(${$this_logo}, 5);
    			}
    		}
                    if (ICL_LANGUAGE_CODE == 'en') { 
     $logo="http://earlymusicbesalu.com/site/wp-content/themes/earlymusicbesalu/images/logo-eng-2012.png";
     } else if (ICL_LANGUAGE_CODE == 'es') { 
     $logo="http://earlymusicbesalu.com/site/wp-content/themes/earlymusicbesalu/images/logo-es-2012.png";
     } else if (ICL_LANGUAGE_CODE == 'ca') {
     $logo="http://earlymusicbesalu.com/site/wp-content/themes/earlymusicbesalu/images/logo-ca-2012.png";
     } else if (ICL_LANGUAGE_CODE == 'fr') {
     $logo="http://earlymusicbesalu.com/site/wp-content/themes/earlymusicbesalu/images/logo-fr-2012.png";
    } 
    		// LOGO OUTPUT
    		$logo_output .= '<div id="logo" class="'.$logo_class.' clearfix">'. "\n";
    		$logo_output .= '<a href="'.$logo_link_url.'">'. "\n";
    		$logo_output .= '<img src="'.$logo.'" alt="'.$logo_alt.'" />'. "\n";
    		$logo_output .= '<img src="'.$retina_logo.'" alt="'.$logo_alt.'" />'. "\n";
    		$logo_output .= '</a>'. "\n";
    		$logo_output .= '<a href="#"><i class="fa-align-justify"></i></a>'. "\n";
    		if ($woocommerce && $show_cart) {
    		$logo_output .= '<a>cart->get_cart_url().'" class="hidden-desktop mobile-cart-link"><i class="sf-cart"></i></a>'. "\n";
    		}
    		if (!$disable_search) {
    		$logo_output .= '<a href="#"><i class="fa-search"></i></a>'. "\n";
    		}
    		$logo_output .= '</div>'. "\n";
    
    		// LOGO RETURN
    		return $logo_output;
    	}
    

    Thanks
    Mohammad

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

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register