Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #371911

    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..

    #371929

    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

    • This reply was modified 8 years, 6 months ago by Yigit.
    #621215

    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

    • This reply was modified 8 years, 6 months ago by chiotis.
    #622465

    Hi!


    @chiotis
    I updated my code above. Please try it now

    Cheers!
    Yigit

    #622856

    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?

    #623021

    Hey!

    I think it would be the best if you contacted Polylang authors as they should have better insight :)

    Cheers!
    Yigit

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.