Language Links in Social Menu - Have Bug in JavaScript Code

Hello team!

Many months ago I received the follow JavaScript line from support so I could include links to different language versions of a website - in the Social Menu:

Add: TC Custom JavaScript (Plugin)

Insert:

jQuery(’#menu-languages li:not(:last-child) a span’).removeClass(‘screen-reader-text’)

It has worked perfectly for many months on the site it was intended for: WWEL.org

Here is how the social menu looks on a computer screen and on a phone:

I have now started a new site that will have multiple languages. I want to do the same thing - put the link(s) to other language versions of the site in the Social Menu.

When I use the SAME JavaScript it works on the new site, BUT only with one social link (icon) in the Social Menu:

A problem occurs when I put two or more social links (icons) in the Social Menu with the JavaScript code for the language links. The code causes the Link Text to appear next to the icon when I put more than one social link (icon) in the Social Menu. This is how it looks and how I have left it on the site under development:

Can the JavaScript code be modified - to still allow Language Links in the Social Menu, but display only the icons, not the Link Text for the social links?

Thank you very much.

Dan

Hello there,

Please share a link to your new site here, so I can have a closer look.

Regards,
Kharis

http://209.182.200.175/~dropsofamazon/

Sorry, Kharis. I thought I included that.

Thank you much!

Hello there,

It looks like we need to apply a few lines of special CSS code for your second site. Try adding this to Appearance > Customize > Additional CSS from dashboard.

    #menu-languages .screen-reader-text,
    #menu-languages li a > span {
      display: none !important;
    }

    #menu-languages li.menu-item-89 a > span {
      display: inline !important;
    }

Regards,
Kharis

It works Kharis! I don’t know how I would function without Athemes support.

Thank you very much! I am sticking with Sydney Pro. I still think most or all of my custom code modifications should be builtin features in the theme itself. The world would be a better place.

Thanks again!

Regards,
Dan

You’re welcome Dan!

Please let us know in a new topic if you have any further questions, or if we can provide you with any other assistance.

Regards,
Kharis