Same logo for both languages
-
Hi
I use Polylang on my website with English and Persian language. I use Astra theme. My question is that how I can have different logo images for different languages?
I installed the Add Polylang support for Customizer
But still it shows same logo for both languages.
I used below code. This code also shows just the default logo. Please help me to solve this problem.
function custom_polylang_multilang_logo( $value ) { if ( function_exists( 'pll_current_language' ) ) { $logos = array( 'en_GB' => wp_get_attachment_image('2400', 'full'), 'fa_IR' => wp_get_attachment_image('2402', 'full'), ); $default_logo = $logos['en_GB']; $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' );
- The topic ‘Same logo for both languages’ is closed to new replies.