Disable the action button for a specific language

Hi.

I’m using Moesia and I have the action button sliding from the top on the welcome screen (#masthead > div.welcome-info > a).

I’m using the Polylang plugin to support two languages.

I don’t want the action button to show on one of these languages. How can I do this?

The welcome-info area also contains an image above the action button - that I want to stay for both languages.

Thank you for your guidance!

Mor

Hello there,

You can hide the main header’s CTA button by adding the below CSS code into your site’s additional CSS option which resides under the Appearance > Customize > Additional CSS.


#masthead > div.welcome-info > a {
  display: none;
}

To hide it on a certain language, use the language locale code which is attributed to the HTML element. So the code will look like this code:


html[lang="en-US"] #masthead > div.welcome-info > a { 
  display: none; 
}  

For multiple languages, you can use this:


html[lang="id-ID"] #masthead > div.welcome-info > a,
html[lang="en-US"] #masthead > div.welcome-info > a { 
  display: none; 
}  

You can find your language code (e.g. lang=“id-ID”) by viewing the source code of your site by using the web browser’s inspector tool. on Firefox, right click and then select Inspect Element. For the sake of visual, please see the following screencast.

Cloudup

Regards,
Kharis

Dear Kharis.

Thank you for a detailed and excellent solution!

Mor

Dear Mor,

Thank you for updating me. I’m glad to hear the short tutorial I wrote worked for you.

I’m marking this topic as resolved. 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