Viewing 11 posts - 1 through 11 (of 11 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

    #1175967

    Hello,
    is it solved in some of the recent updates? It seems to me that I have the same problem and even more.
    I have Polylang Version 2.6.9 Enfold 4.7.1 and WP 5.3.2
    Right now I have set the settings in Polylang to “The language is set from the directory name in pretty permalinks” and the link in the logo is not set correctly, but once I switch the settings to “The language is set from content” the whole this is broken and none of the links works as they should (Logo and flags)

    #1176342

    Hi,


    @lucaus
    : It seems to be working properly when we check. The logo of both languages contain the appropriate links. Did you use the filter above?

    Best regards,
    Ismael

    #1215013

    Hi,
    For some reason, in my example, the logo does not accept this function:

    function pojo_polylang_get_multilang_logo( $value ) {
    	if ( function_exists( 'pll_current_language' ) ) {
    		$logos = array(
    		
    	'sr' => 'logo1.png',
    	'en' => 'logo2.png',
    
    		);
    		$default_logo = $logos['sr'];
    		$current_lang = pll_current_language();
    		$assets_url = get_stylesheet_directory_uri() . '/assets/';
    		if ( isset( $logos[ $current_lang ] ) )
    			$value = $assets_url . $logos[ $current_lang ];
    		else
    			$value = $assets_url . $default_logo;
    	}
    	return $value;
    }
    add_filter( 'avf_logo', 'pojo_polylang_get_multilang_logo' );

    ..persistently ignores the permalink and points to a non-existent page.

    Thank for advice
    Darko

    #1215027

    Solved !

    Conflict between home page choices in wp-dashboard settings and Enfold Frontpage Settings cause that Logo URL get wrong prefix.

    Regards

    #1215123

    Hey Dare_Care,

    I’m glad this was resolved for you!

    Best regards,
    Jordan Shannon

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.