• Resolved rhpg

    (@rhpg)


    Dear team,

    I want to hide the active language flag in the menu of my 2 languages website (nl_NL and en_US). So I tried as explained on https://translatepress.com/docs/developers/show-opposite-language-in-language-switcher/:

    1) CSS Classes is checked

    2) I added tp-en resp. tp-nl as suggested in CSS Class field of the language switcher menu items:
    Label: Dutch, CSS Class: trp-language-switcher-container tp_nl
    Label: English, CSS Class: trp-language-switcher-container tp_en

    3) I added the following code in the Extra CSS:
    .translatepress-en_US .tp_en,
    .translatepress-nl_NL .tp_nl
    { display: none; }

    However, both flags remain visible.

    Maybe this is related to something strange happening in the CSS Class fields in the language switcher menu items:
    – If I enter: “trp-language-switcher-container tp_nl” and close and re-open this field, it then says: “trp-language-switcher-container tp_nl trp-language-switcher-container”.
    – If I close and re-open again it says: “trp-language-switcher-container tp_nl trp-language-switcher-container trp-language-switcher-container”. So for some reason it keeps on adding “trp-language-switcher-container”.
    – For testing purposes, I cleared these CSS Class fields in the menu and then only entered “tp-en”. If I close and re-open the field, it then says: “tp-en trp-language-switcher-container”.

    I also had my website hosting provider look into this issue. He also followed the steps on https://translatepress.com/docs/developers/show-opposite-language-in-language-switcher/ but with the same outcome. They suspect that the code may be outdated.

    Can you please look into what the problem is? Or better: the solution!?

    Many thanks.

    Kind regards,
    Rob

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Dragos

    (@dragosvrejiu)

    Hello Rob,

    Could you try adding !important after display:none?

    So it should look something like this:

    {display:none ! important;}

    It might me some code that overwrites the CSS.

    Let me know if this solves the issue.

    Best regards,

    Thread Starter rhpg

    (@rhpg)

    Thank you Dragos. Unfortunately this doesn’t help…

    Thread Starter rhpg

    (@rhpg)

    Dear Dragos, please let me know what I can do to hide the active language flag.

    Thank you,
    Rob

    Dragos

    (@dragosvrejiu)

    Hello Rob,

    Sorry for the late reply – there has been a great load on our support team lately and somehow your ticket got lost.

    I have tried the same code using English and Dutch but it worked as expected.

    Could you please try putting the menu items one near the other instead of having them in a sub-menu?

    Best regards,

    Thread Starter rhpg

    (@rhpg)

    That’s it Dragos, now it finally works! Thank you so much, you just made my day 🙂

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Hide active language does not work’ is closed to new replies.