• Hey There

    Is it possible to create multiple Language Switchers Menus?
    What I need is a Language Switcher Menu for Swiss-Francs (DE, FR, IT) because it shows swiss francs informations. I need another Lanugage Switcher Menu for Euro (DE, FR, IT, EN).

    If some one is on the Swiss Page in swiss francs I need to hide the languages for Euro prices.

    Swiss-Menu:
    it_CH
    fr_CH
    de_CH

    Euro-Menu:
    de_DE
    en_US
    fr_FR
    it_IT

Viewing 3 replies - 1 through 3 (of 3 total)
  • Customized language switchers can be build with a function pll_the_languages( array( 'raw' => 1 ) );

    The function will return an array of arrays, one array per language <– You can use it to create your own switcher functionality. More details in Polylang documentation: polylang.pro/doc/function-reference/#pll_the_languages

    Thread Starter blubbering

    (@blubbering)

    Hm… it’s not working. If i add raw = 1 it shows just “array” nothing else, if I add the default, it shows all languages twice:

    if (function_exists('pll_register_string')) {
    	//pll_the_languages( array( 'raw' => 1 ) ); // Output: Array
    	//pll_the_languages( array( 'raw' => 0 ) ); // Output: All languages twice
    	//pll_the_languages(); //Output: All Languages
    }

    Target is to have two switchers for CH and EU.

    As veerap wrote

    The function will return an array of arrays, one array per language <– You can use it to create your own switcher functionality.

    This is why you get array as a result. You need to write your own switcher, based on this function.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘create different language Menus’ is closed to new replies.