• Hey,

    I have a multi-language site and I use WPML.

    How can I change the logo based on the language?

    I tried to find the string in WPML but I didn’t find it.

    Can you please help me with it.

    Thanks

Viewing 1 replies (of 1 total)
  • Hi.

    We have a couple filter and they can help you.

    <?php
    add_filter('mailtpl/templates/header_logo','custom_header_logo', 10, 1);
    add_filter('mailtpl/templates/header_logo_alt','custom_header_logo_alt',10, 1);
    
    function custom_header_logo($url_image) {
    
    	if (defined('ICL_LANGUAGE_CODE')) {
    		switch( 'ICL_LANGUAGE_CODE' ) {
    			case 'en' : $url_image = 'you/url/image_en'; break;
    			case 'es' : $url_image = 'you/url/image_es'; break;
    		}
    	}
    
    	return $url_image;
    }
    
    function custom_header_logo_alt($alt_image) {
    
    	if (defined('ICL_LANGUAGE_CODE')) {
    		switch( 'ICL_LANGUAGE_CODE' ) {
    			case 'en' : $alt_image = 'alt_en'; break;
    			case 'es' : $alt_image = 'alt_es'; break;
    		}
    	}
    
    	return $alt_image;
    }
    ?>

    If you like the plugin / support please leave a short review. It’s a tremendous help for us!

    Thanks

    • This reply was modified 6 years, 9 months ago by gonzalesc.
Viewing 1 replies (of 1 total)
  • The topic ‘Change logo based on language’ is closed to new replies.