0

I used q-translate on a Wordpress website and placed their "choose language" code in the menu. When you visit the website in its default language (Dutch), the sub menu with "the language overview" is closed, like this: screenshot 1

But when I choose an other language (and I guess when someone visit the website with an other language as default), the sub menu is open on default, like this: screenshot 2

I want my sub menu to be closed by default when an visitor with an other default language visits (or after an other language is chosen in the menu), like my default language. How can I do this? I'm not really good in php / js... I Googled my problem but could not find an direct answer (it looks like the plugin makers are not active anymore). I hope somebody can help me.

Thanks in advance!

b33tle
  • 1

1 Answers1

0

You could try to fix it by using CSS.

For example, the english language selected should have .qtranxs-lang-menu-en class, so try to add something like this:

.qtranxs-lang-menu-en ul.sub-menu {
display:none;
}
user8230352
  • 1,775
  • 1
  • 9
  • 13
  • Thanks for the suggestion. I tried this and used other classes too, but the only thing I achieved was to let the sub-menu disappear completely. When loading the English version, I see the plugin is adding the classes ".active" and ".open-sub" as default on my menu li item. I was trying to find these classes in the php files from qTranslate but can't seem to find them. Is there an code to add in my functions.php perhaps? Maybe by removing the classes when the homepages is loading? – b33tle Aug 03 '17 at 11:15
  • I think the classes in menu that do not start with "qtranxs" are added by WordPress itself when rendering the menu. – user8230352 Aug 03 '17 at 11:22