Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter Wincher

    (@wincher)

    ok…I understand now.
    Perfect! Thanks you

    Thread Starter Wincher

    (@wincher)

    Here comes.
    https://hpics.li/a2ef19a

    Maybe it’s about my wordpress theme (= Divi).
    I create english version inside the french page
    https://hpics.li/199fc68 (cf upper right)

    Thread Starter Wincher

    (@wincher)

    Thanks you but this is what I did already…

    Go to this page please https://les3chalets-courchevel.com/le-chalet-lor-blanc/ (be sure website is in french).
    -> Click on dropdown -> English.
    -> Menu and page content are in english. You confirm?

    -> Click on the item : The “S” (menu is in english).
    -> Page is in french (and menu too)…

    Forum: Plugins
    In reply to: [Polylang] Dropdown flag
    Thread Starter Wincher

    (@wincher)

    You’re incredible !
    Thanks you so much

    Forum: Plugins
    In reply to: [Polylang] Dropdown flag
    Thread Starter Wincher

    (@wincher)

    Thanks you for your answer!
    Maybe I did not express myself well, I don’t want a dropdown with flag images but just a dropdown with html-text languages.
    I insert <?php pll_the_languages(array(‘dropdown’=>1)); ?> inside header.php. But link inside dorpdown doesn’t work.
    I rode a post about this and it was mentioned to fix a part of code inside widget-languages.php but I’m nos sure about what I have to do.

    I think it’s about this :

    function widget($args, $instance) {
    	global $polylang;
    	foreach ($polylang->get_languages_list() as $language) {
    	$url = $polylang->get_translation_url($language);
    	$urls[] = '"'.esc_js($language->slug).'":"'.esc_url($url).'"';
    	}
    
    	$urls = implode(',', $urls);
    
    		// javascript to switch the language when using a dropdown list
    		if ($dropdown) {
    			foreach ($polylang->model->get_languages_list() as $language) {
    				$url = $force_home || ($url = $polylang->links->get_translation_url($language)) == null ? $polylang->links->get_home_url($language) : $url;
    				$urls[] = '"'.esc_js($language->slug).'":"'.esc_url($url).'"';
    			}
    
    			$urls = implode(',', $urls);
    
    			$js = "
    				<script type='text/javascript'>
    					//<![CDATA[
    					var urls = {{$urls}};
    					var d = document.getElementById('lang_choice');
    					d.onchange = function() {
    						for (var i in urls) {
    							if (this.value == i)
    								location.href = urls[i];
    						}
    					}
    					//]]>
    				</script>";
    
    			echo $js;
    		}
    	}

    Could you help me?

    Thread Starter Wincher

    (@wincher)

    Hello !

    Thanks for your answer.
    You’re right, I forgot that ??

    Now, theres is a english menu but the problem is the same.
    When you switch to english langage, site switch back automatically to french when you click on the menu. I insert a direct link (cf “Chalet S directlink” on the english menu) and it’s working, but it’s not a good solution.

    Thanks you

Viewing 6 replies - 1 through 6 (of 6 total)