Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1317207

    Hi,
    I am translating my site in English and I can`t find a way to translate the logo. I am using Polylang, I have found the following topic, but it is not working for me:

    I will be grateful if you can help.
    Thank you.

    Galina

    #1317410

    Hey galgro,

    Thank you for the inquiry.

    Did you adjust the language locale in this line?

    if ($lang == 'fr_FR') 
    

    If you are trying to change the logo in the English version for example, the locale should be “en_US”.

    
    function av_change_logo($logo){
       $lang = pll_current_language('locale');
       if ($lang == 'en_US') 
       {
            $logo = "LOGO URL FOR ENGLISH LANGUAGE HERE";
       }
        return $logo;
    }
    add_filter('avf_logo','av_change_logo');
    

    Best regards,
    Ismael

    #1317451

    Hello, Ismael,

    Thank you.
    Can I put this code in the Quick CSS redactor?
    Actually I tried, but it doesn`t work.
    Or can I put some code there, which can help.

    I have also problems with the Copyright text in the Socket for the both languages. The default language is Bulgarian and the second is English.
    How can I a remove the Kriesi link from the both languages:
    © Copyright – Strategic Framework for Development of Education, Training and Learning in the Republic of Bulgaria (2021 – 2030) – Enfold Theme by Kriesi
    © Copyright – Стратегическа рамка за развитие на образованието, обучението и ученето в Република България (2021 – 2030) – Enfold Theme by Kriesi

    Thank you.
    Galina

    #1317469

    I solved the problem with the links by putting [nolink] after the two texts in the translation of Strings section.

    I just cant find the way to change the logo for the english version of the site.
    I hope you can help.

    Galina

    #1317473

    Actually the text [nolink] is now visible, so the problem with the Kriesi link for the both languages is also not solved.
    I hope you can help.
    Thank you.

    Galina

    #1317501

    Sorry for the many messages.
    I put the following code in the function.php file and now the logo is bilingual and the text in the socket also changes correctly in both languages.

    function av_change_logo($logo){
    $lang = pll_current_language(‘locale’);
    if ($lang == ‘en_GB’)
    {
    $logo = “https://edu-strategy.mon.bg/wp-content/uploads/2021/08/Logo_MON_470x138px_EN.png”;
    }
    return $logo;
    }
    add_filter(‘avf_logo’,’av_change_logo’);

    add_filter(‘kriesi_backlink’,’socket_per_language’);
    function socket_per_language(){
    $currentlang = get_bloginfo(‘language’);

    if($currentlang==”en_GB”) {
    $output = “© Copyright – Strategic Framework for Development of Education, Training and Learning in the Republic of Bulgaria (2021 – 2030).”;
    }
    elseif($currentlang==”bg_BG”) {
    $output = “© Copyright – Стратегическа рамка за развитие на образованието, обучението и ученето в Република България (2021 – 2030).”;
    }
    return $output;
    }

    Galina

    #1317599

    Hi,

    Great! Glad to know that the filter is now working. Let us know in another thread if we can help you with anything else.

    Have a nice day.

    Best regards,
    Ismael

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Translate Logo using Polylang’ is closed to new replies.