Greetings,
I created a Multilingual site with Enfold and the Polylang plugin.
English page urls start with /en/ and French ones witch /fr/
Can I show a different logo image in the header depending if the page is in French or English?
Thanks,
Edz..
Hey Ranitz!
Please try adding following code to Functions.php file in Appearance > Editor
function show_current_language() {
global $curlang;
$curlang = $this->curlang->slug;
}
add_filter('avf_logo','av_change_logo');
function av_change_logo($logo)
{
if($curlang=="en")
{
$logo = "http://kriesi.at/wp-content/themes/kriesi/images/logo.png";
}
elseif($curlang=="fr")
{
$logo = "http://kriesi.at/themes/angular/wp-content/themes/angular/images/layout/logo.png";
}
return $logo;
}
If that does not work, please try changing en_EN and fr_FR to locale of the languages you set in plugin options.
Best regards,
Yigit
Hello,
I need the same thing. I am using the Polylang plugin and need to show a different logo based on the lang code.
I added the above code in functions.php of enfold child theme and change the lang codes and urls accordingly.
There no change at all. Nothing happened. Is this code workable or needs update, since it is dated back in 2014?
thanks in advance
Christos
Unfortunately it doesn’t work.
Maybe is it supposed to work only in the parent theme?
Maybe Polylang uses something else other than curlang?
The lang codes are the same as they are registered in Polylang’s settings
Any ideas?