Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
pojo.me + WPML: Change your sticky logo by language
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