• Resolved makc57

    (@makc57)


    Dear Stephane,

    How to display different logo per language using Polylang? Maybe its possible to call it using Strings or is there any other solution?

    …Also
    I managed to find a code snippet for other plugin. As far I understand we can adopt it for Polylang if we find right function instead of “pll_current_language”.
    What would be Polylang function to determine current language?

    function custom_polylang_multilang_logo( $value ) {
    	if ( function_exists( 'pll_current_language' ) ) {
    		$logos = array(
    			'en' => wp_get_attachment_image('8841', 'full'),
    			'ru' => wp_get_attachment_image('7679', 'full'),						
    			'lv' => wp_get_attachment_image('11138', 'full'),
    		);
    		$default_logo = $logos['lv'];
    		$current_lang = pll_current_language();
    		if ( isset( $logos[ $current_lang ] ) )
    			$value = $logos[ $current_lang ];
    		else
    			$value = $default_logo;
    	}
    	$html = sprintf( '<a href="%1$s" class="custom-logo-link" rel="home" itemprop="url">%2$s</a>',
                esc_url( home_url( '/' ) ),
                $value
            );
    	return $html;
    }
    add_filter( 'get_custom_logo', 'custom_polylang_multilang_logo' );

    Kind regards,

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author sbouey

    (@sbouey)

    How do you set your logo in your plugin

    Falang can translate option, perhaps an option for the logo in the template is available

    What is your theme ?

    Stéphane

    Plugin Author sbouey

    (@sbouey)

    to complete my previous mail you can use with custom code like polylang

    Falang()->get_current_language()->locale

    you can make a swtich with the locale

    Stéphane

    • This reply was modified 2 years, 2 months ago by sbouey.
    Thread Starter makc57

    (@makc57)

    Dear Stephane,

    Many Thanks again for your support!

    Managed to find string in Translation Options – “site_logo” ??

    Kind regards,
    Max

    • This reply was modified 2 years, 1 month ago by makc57.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Setup different logo per language’ is closed to new replies.