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

    Hi,

    The logo on my website will be changed when I change language. Set it up via functions.php:

    add_filter(‘avf_logo’,’av_change_logo’);
    function av_change_logo($logo)
    {
    $lang = pll_current_language(‘locale’);
    switch ($lang) {
    case ‘fr_FR’:
    $logo = “/wp-content/uploads/Logo_FR.png”;
    break;
    case ‘de_DE’:
    $logo = “/wp-content/uploads/Logo_DE.png”;
    break;
    }

    return $logo;
    }

    The problem is that clicking on the French logo calls the wrong URL (only “…/fr/” instead of “…/fr/home-4/”). Because the Polylang plugin works correctly, I think that the URL is accessed via the theme. Can this URL be customized?

    #987302

    Hi,
    I don’t know why, but it works now. Problem solved.
    Best regards,
    Esther

    #987429

    Hi,
    Did you make any changes to my website this morning? Because: now the problem exists again.
    Thank you for your Feedback.

    Best reagards,
    Esther

    #987566

    Hi,

    Please try to add this code to your child theme functions.php file:

    
    add_filter('avf_logo_link','av_change_logo_url');
    function av_change_logo_url($link)
    {
        $lang = pll_current_language(‘locale’);
        if ($lang == 'fr_FR') 
        {
            $link = "https://fallback.zugerberg-finanz.ch/fr/home-4/";
        }
        return $link; 
    
    }
    

    Best regards,
    Dude

    #987732

    Hi Dude,

    Thank’s for that… I replaced that line (wrong quotes):

    $lang = pll_current_language(‘locale’);

    Now it works perfectely :-)

    Have a nice Day,
    Best regards, Esther

    #988010

    Hi Esther,

    Glad you got it working for you! :)

    If you need further assistance please let us know.

    Best regards,
    Victoria

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.