Wincher
Forum Replies Created
-
Forum: Plugins
In reply to: [Polylang] Switch language autook…I understand now.
Perfect! Thanks youForum: Plugins
In reply to: [Polylang] Switch language autoHere comes.
https://hpics.li/a2ef19aMaybe it’s about my wordpress theme (= Divi).
I create english version inside the french page
https://hpics.li/199fc68 (cf upper right)Forum: Plugins
In reply to: [Polylang] Switch language autoThanks 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 flagYou’re incredible !
Thanks you so muchForum: Plugins
In reply to: [Polylang] Dropdown flagThanks 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?
Forum: Plugins
In reply to: [Polylang] Switch language autoHello !
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