Tagged: 

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #793797

    Hi support,

    Of course I did some research on your forum already for my issue. I found 3 variations of code to put in functions.php in the child theme but for each variation I receive a syntax error.

    Could you please provide a valid code to use to switch the logo for a different language?

    Thanks in advance, best regards

    #793957

    Hey mustmedia,

    Could you specify which code you tried and which error you got, please?
    Can you give us temporary admin access to your website in the private content box below, so that we can have a closer look.

    Best regards,
    Victoria

    #793961

    Hi,

    1. I add the code to functions.php in child theme
    2. I activate the child theme
    3. The error is that I see the code in my backend and also on top of the website frontend.

    I tried this code from thread https://kriesi.at/support/topic/different-logo-for-every-language/:

    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;
    }

    I tried this code from thread https://kriesi.at/support/topic/different-logos-in-different-languages/:

    add_filter('avf_logo','av_change_logo');
    function av_change_logo($logo)
    {
    $currentlang = get_bloginfo('language');
    if($currentlang=="en-US")
        {
        $logo = "http://kriesi.at/wp-content/themes/kriesi/images/logo.png";
        }
    if($currentlang=="fr-FR"){
        {
        $logo = "http://kriesi.at/wp-content/themes/kriesi/images/logo.png";
        }
        return $logo;
    }

    And I tried this code from thread https://kriesi.at/support/topic/polylang-logo-changer/:

    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 find in private a temporary account for WP and FTP

    • This reply was modified 7 years, 4 months ago by mustmedia.
    #793967

    Hi,

    Can you please post WP admin logins and FTP logins here privately so we can look into it? :)

    Best regards,
    Yigit

    #793971

    Please see above.

    #793974

    Hi,

    PHP opening tag was missing in functions.php file of your child theme. I have added it, activated child theme, went to Enfold child theme options > Import & Export tab and imported parent theme options. Please review your website now.

    Also, you are currently using an older version of the theme. The latest version of Enfold is 4.0.5 – kriesi.at/documentation/enfold/updating-your-theme-files/.
    You can read more about the release here – http://kriesi.at/archives/enfold-reimagined-version-4-0 :)

    Best regards,
    Yigit

    #794008

    Hi Yigit,

    Thanks. I needed to re-save the menu in order to have it correct.

    Best regards

    • This reply was modified 7 years, 4 months ago by mustmedia.
    #794181

    Hi mustmedia,

    Glad you we could help and you got it working for you ! :)

    If you need further assistance please let us know.

    Best regards,
    Victoria

    #1175452

    Hi,,

    Which code should I use to change the logo according to the language ?!?

    And what should the code look like if the log files are locally on the server?!?

    Thanks in advance!

    BR
    Venty

    #1175636

    Hi Venty,

    You can use the code from here, just adjust it to your needs:
    https://kriesi.at/support/topic/polylang-logo-changer/#post-576507

    Best regards,
    Victoria

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