• How I can change logo per language?
    So if im main language EN I see english logo.

    And if I switch language example to RU then I should see russian language logo.

    I’ve tried also your logo filters but these doesnt work at all.

Viewing 1 replies (of 1 total)
  • Plugin Author Phil

    (@philsbury)

    Hi @veltix,

    What filters did you try?

    There are two filters available depending on whats easiest for where your logos come from, if they’re just in a theme for example, then you can filter the url:

    add_filter('age_gate/logo/src', function($logo) {
        // get your language - a multilingual plugin may have functions to get current language
    
        $language = substr(get_locale(), 0, 2);
    
        switch (strtolower($language)) {
            case 'fr':
                return get_template_directory_uri() . '/full/url/to/en.png';
            case 'ru':
                return get_template_directory_uri() . '/full/url/to/ru.png';
            default:
                return $logo;
        }
    });

    If you know the IDs of the image you want, you could do, but this happens before the above filter:

    add_filter('age_gate/logo/id', function($id) {
        // get your language - a multilingual plugin may have functions to get current language
    
        $language = substr(get_locale(), 0, 2);
    
        switch (strtolower($language)) {
            case 'fr':
                return 123;
            case 'ru':
                return 456;
            default:
                return $id;
        }
    });

    Thanks,
    Phil

Viewing 1 replies (of 1 total)
  • The topic ‘Change logo on each language’ is closed to new replies.