I have a multilingual website. Is there a way I can change the logo.png
to a different .png
after I switch to "India"? I am using polylang plugin at this moment. I tried this solution but it did not work - https://support.pojo.me/docs/polylang-change-logo-every-language/.
Does any one know how to fix this issue?
my code
function pojo_polylang_get_multilang_logo( $value ) {
if ( function_exists( 'pll_current_language' ) ) {
$logos = array(
'en' => 'logo-en.png',
'in' => 'logo-in.png',
);
$default_logo = $logos['en'];
$current_lang = pll_current_language();
$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_logo', 'pojo_polylang_get_multilang_logo' );
en
– Ovenwaretheme_mod_image_logo
. Isn't that specific to a specific theme? Do you use that theme? – Feliclevar_dump(pll_current_language());
orwrite_log(pll_current_language());
to make sure that the Indian language abbreviation is in . Since if it is returning a different language code always the english language will be used. – Comines