Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #576444

    Hi Guys.

    Apologies! But Im not sure who to contact here. I have the Polylang plugin installed into my website. I want the logo to change for each different language. I tried this solution but it didnt work. > http://support.pojo.me/docs/polylang-change-logo-every-language/

    Not sure if its an Enfold issue?

    #576507

    Hey zedduo!

    Please add 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";
        }
        if($curlang == "af") {
        $logo = "http://kriesi.at/wp-content/themes/kriesi/images/logo.png";
        }
        return $logo;
    }

    and change logo links as needed

    Best regards,
    Yigit

    #576873

    Hi Yigit

    Thanks for the reply!!

    Unfortunately, that didn’t work. Im getting a syntax error. Not sure if its missing something else. Im using a Child theme and I dont have anything in the functions.php file :)

    • This reply was modified 8 years, 10 months ago by zedduo. Reason: added child theme note
    #577540

    Hi,

    Please send us a temporary admin login so that we can have a closer look. You can post the details in the Private Content section of your reply.

    Regards,
    Rikard

    #577642

    Hi Rikard.

    Thanks for the reply! See below.

    #579375

    Hey!

    We modified the code in the functions.php file a bit.

    add_filter('avf_logo','av_change_logo');
    function av_change_logo($logo)
    {
    	$lang = pll_current_language('locale');
    
    	switch ($lang) {
        case 'en_US':
            $logo = "http://kriesi.at/wp-content/themes/kriesi/images/logo.png";
            break;
        case 'af':
            $logo = "http://kriesi.at/wp-content/themes/kriesi/images/logo.png";
            break;
    	}
    
    	return $logo;
    }
    

    Please adjust the the logo image url.

    Regards,
    Ismael

    #579437

    Awesomeness! Thanks guys! You can close this ticket.

    #580100

    Hi,

    Great, glad we could help :-)

    Regards,
    Rikard

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Polylang logo changer’ is closed to new replies.