helloimrob
Forum Replies Created
Viewing 3 replies - 1 through 3 (of 3 total)
-
Forum: Plugins
In reply to: [Polylang] Dropdown doesnt workthanks a lot Chouby :)!
Forum: Plugins
In reply to: [Polylang] Dropdown doesnt workHi! Thanks a lot for the fast answer. Added the code. Now no error anymore, but it still doesnt work :/
Forum: Plugins
In reply to: [Polylang] Dropdown doesnt workHi!
Thanks for the fast answer and link, didnt read that before.Could you tell me/us which code I have to use to get the dropdown working? Or is this too complicated?
Im new with PHP, so I just included everything regarding your in-code comments: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;but this (maybe obviously) didn’t worked.
Thanks!
Viewing 3 replies - 1 through 3 (of 3 total)