[Resolved] Trouble with polylang on mobile menu

Home Forums Support [Resolved] Trouble with polylang on mobile menu

Home Forums Support Trouble with polylang on mobile menu

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1989648
    supazena

    Hi,
    A first, I want to say GeneratePress is my favorite WP theme. It’s a very nice job you do!!!

    Here is situation and trouble:

    I use Polylang for 2 language on my WP.
    Primary language available on mydomain.com
    Secondary is english version available on mydomain.com/en

    I put flag on the menu and all works very fine except one thing.
    You have to know I use font for my main logo on desktop and mobile version (no image for my logo).

    On desktop : if I switch to secondary language then clic on the name of my site (logo), site load secondary language homepage (mydomain.com/en) and it’s fine.
    On mobile : if I do the same exact way, site load primary language home page (mydomain.com instead mydomain.com/en), here is my trouble.

    Do you have any idea to solve this issue ?

    Regards
    Greg, France

    #1990303
    Ying
    Staff
    Customer Support

    Hi Greg,

    Can you give this PHP snippet a try:

    add_filter( 'generate_logo_href','tu_add_custom_logo_href' );
    function tu_add_custom_logo_href( $url ) {
         if ('en_GB' === get_locale()) {
    	  return '/en';
    	}
    	return $url;
    }

    Adding PHP: https://docs.generatepress.com/article/adding-php/

    Let me know πŸ™‚

    #1990500
    supazena

    Hi Ying,

    Thank you for your message, snippet set into functions.php the active child theme but has no effect.
    In mobile, when I am on an english page then clic my text logo = I go to the FR homepage instead EN.

    I let the code into functions.php for the moment.

    Regards

    #1990522
    Ying
    Staff
    Customer Support

    Ah sorry, I mistakenly thought the site title was a logo, then try this snippet instead:

    add_filter( 'generate_site_title_href','tu_add_custom_site_title_href' );
    function tu_add_custom_site_title_href( $url ) {
         if ('en_GB' === get_locale()) {
    	  return '/en';
    	}
    	return $url;
    } 

    Let me know πŸ™‚

    #1991469
    supazena

    πŸ‘Œ Perfect, thanks you so much !

    #1991561
    Ying
    Staff
    Customer Support

    You are welcome πŸ™‚

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