Tagged: header, Insert Code, Language, wpml
-
AuthorPosts
-
June 12, 2023 at 1:21 pm #1410341
Hello,
how can I add the Code {wpm_language_switcher} next to my Burger Menu of my Website Header?
The Short code creates is a Dropdown Menu, where you can choose Languages. Now I want that this created Dropdown Menu is showed next to my Burger Button. So where should I insert the Code {wpm_language_switcher} ?
http://www.wandelhalle-hamburg.de
Thank YOU!
June 13, 2023 at 4:18 am #1410409Hey Anna_Tewes,
Thank you for the inquiry.
You can use template hooks to insert the language switcher beside the burger menu or anywhere on the page. To achieve this, please add the following code to the functions.php file of your theme:
function ava_icl_language_selector(){ do_action('wpml_add_language_selector'); } add_action('ava_after_main_menu', 'ava_icl_language_selector');
This may require a few css adjustments.
Best regards,
IsmaelJune 13, 2023 at 8:03 am #1410416Hey, Thank You! When I add the code to my PHP then it look like this -> https://ibb.co/CVvmG9h
is it possible that you can help me to get it in the right corner?
June 13, 2023 at 10:51 am #1410424on WPML – Langage – there are options – what happens if you insert it to main-menu:
June 13, 2023 at 10:59 am #1410425When you activate this one. You only see the Language Switcher inside the Menu when you click on the Burger. I think it would be much better if its outside of the Burger.
June 13, 2023 at 11:44 am #1410434June 13, 2023 at 12:16 pm #1410439OK maybe you got an older Version of WPML than mine
first put this to your quick css:
.js_active.html_burger_menu #avia-menu > li.av-language-switch-item { display: block; } .language_flag img { width: 30px !important; top: 6px; position: relative; outline: 2px solid #B52828; } .av-burger-overlay-active .language_flag img { outline: 2px solid #FFF; } .av-burger-overlay-active #menu-item-search a { color: #FFF !important }
June 13, 2023 at 1:23 pm #1410455okey should I insert the PHP Code first and then your quick CSS? Thank you for your help
June 13, 2023 at 1:26 pm #1410457oh wow, it worked really well. BIG THANKS
June 13, 2023 at 2:57 pm #1410465Also ich habe es in einer Testinstallation mittels WPML Menü Sprachumschalter gemacht, und dann nur css angewandt.
Eventuell hatte ich dadurch etwas andere Selectoren als Du. Lass es doch einfach jetzt so – so sieht es gut aus.June 14, 2023 at 8:39 am #1410545Eine Sache nur noch, bei Mobil sind die Borders um den Flaggen noch nicht ganz richtig. Wie könnte man die noch Mobil anpassen?
Danke für deine Hilfe!
June 14, 2023 at 9:07 am #1410547ändere die eine Regel mal auf:
da war der andere Selector selectiver ;).responsive #top #wrap_all .av-logo-container a .language_flag img { width: 30px !important; top: 6px; position: relative; outline: 2px solid #B52828; height: 20px !important; }
hast du was an den hamburger Farben geändert – die waren vorher weiß im geöffneten Zustand
bin – jetzt kurz weg – nachher mehr.June 14, 2023 at 9:26 am #1410548ja perfekt, jetzt läuft das auch auf Mobil. Vielen Dank, du warst mit eine große Hilfe.
June 14, 2023 at 9:35 am #1410549Ich habe nichts an den Farben geändert.
June 14, 2023 at 10:13 am #1410551auf screenweiten kleiner als 768 px ist der Hamburger Button in geöffnetem Zustand rot – daher nocht folgendes:
@media only screen and (max-width:767px) { .av-burger-overlay-active #top .header_color .av-hamburger-inner, .av-burger-overlay-active #top .header_color .av-hamburger-inner::before, .av-burger-overlay-active #top .header_color .av-hamburger-inner::after { background-color: #FFF } }
und den einen selctor müssen wir auch selectiver machen:
.responsive.av-burger-overlay-active #top #wrap_all .av-logo-container a .language_flag img { outline:2px solid #FFF }
June 14, 2023 at 10:17 am #1410555insgesamt also:
.js_active.html_burger_menu #avia-menu > li.av-language-switch-item { display: block; } .responsive #top #wrap_all .av-logo-container a .language_flag img { width: 30px !important; top: 6px; position: relative; outline: 2px solid #B52828; height: 20px !important; } .av-burger-overlay-active .language_flag img { outline: 2px solid #FFF; } .responsive.av-burger-overlay-active #top #wrap_all .av-logo-container a .language_flag img { outline:2px solid #FFF } @media only screen and (max-width:767px) { .av-burger-overlay-active #top .header_color .av-hamburger-inner, .av-burger-overlay-active #top .header_color .av-hamburger-inner::before, .av-burger-overlay-active #top .header_color .av-hamburger-inner::after { background-color: #FFF } }
June 28, 2023 at 3:34 pm #1411961Hey, der Kunde möchte es lieber ein Dropdown Menü am selben Bereich haben. Wie würde das funktionieren? Das man auf eine Flagge oder so klickt und dann kommen die zwei Auswahlen?
July 9, 2023 at 5:29 pm #1412884Hi,
It seems that you have a second thread for the same topic.Best regards,
Mike -
AuthorPosts
- You must be logged in to reply to this topic.