I have this multilingual website. Is there a way I can change the logo.png to a different .png after I switch to “Chinese?”
I am using polylang plugin at the moment and this is what I have scrummed together:
$(function() {
if (pll_current_language == 'en') {
$('.logo').css("background-image", "url(images/logo.png)");
} else if (pll_current_language == 'zh') {
$('.logo').css("background-image", "url(images/logo-CN.png)");
} else {
$('.logo').css("background-image", "url(images/logo.png)");
}
});
Changing
to
should work, you are missing the “()” after “pll_current_language”
EDIT: Try this: