Site logo

Archived topic

WPML selector clic to expand on mobile menu

3 replies · Started by Alberto on January 26, 2021

Viewing posts 1–4 of 4

Hello
I need to change the behavior of the language selector in the mobile menu in arenatours.com
What I need is to expand the language submenu when I click on the name of the language, i.e., same behavior as if you click on "Otros destinos", not only clicking the arrow but also the name.
Can you help me to achieve it, please?

Thanks in advance

Hi there,

That's quite tricky to do because unlike the "Otros destinos" button, the "Español" button is an actual link. Clicking on it will load the site because it has an actual destination while "Otros destinos" is just a simple button without destination(href="#").

That said, consider changing how the language button is structured.

Perhaps add "Español" as a sub-menu and change the menu item for language change to "Language" or "Change Language" and set its link to # so it serves as a dropdown toggle rather than an actual link, similar to how "Otros destinos" menu and its submenu is structured.

Hi Elvin
Thanks for replying!
What about if I need to show the current language instead the label "Language"?

Regards

Hi there,

you could try adding this CSS:

@media(max-width: 768px) {
  .wpml-ls-item .dropdown-menu-toggle {
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    text-align: right;
  }
}

It simply forces the Toggle to occupy the whole menu item.

This archived topic is closed to new replies.