Created
January 29, 2015 12:35
-
-
Save KingYes/12c8100dead57d78972c to your computer and use it in GitHub Desktop.
pojo.me + WPML: Change your sticky logo by language
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function pojo_wpml_get_multilang_sticky_logo( $value ) { | |
if ( defined( 'ICL_LANGUAGE_CODE' ) ) { | |
$logos = array( | |
'en' => 'logo-sticky-en.png', | |
'he' => 'logo-sticky-he.png', | |
); | |
$default_logo = $logos['en']; | |
$current_lang = ICL_LANGUAGE_CODE; | |
$assets_url = get_stylesheet_directory_uri() . '/assets/images/'; | |
if ( isset( $logos[ $current_lang ] ) ) | |
$value = $assets_url . $logos[ $current_lang ]; | |
else | |
$value = $assets_url . $default_logo; | |
} | |
return $value; | |
} | |
add_filter( 'theme_mod_image_sticky_header_logo', 'pojo_wpml_get_multilang_sticky_logo' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment