Skip Navigation

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 7 replies, has 2 voices.

Last updated by Mihai Apetrei 1 month ago.

Assigned support staff: Mihai Apetrei.

Author Posts
October 16, 2021 at 3:28 pm #9802933

fengP

Our site supports membership. We are trying to add "alipay" as a payment method for Chinese customer. However, the "alipay" company doesn't support "Membership" and requests to remove membership from the website if the current language is "Chinese".

What's the best way to do this? we have menus and some contents for "membership".

Thanks

October 16, 2021 at 9:32 pm #9803529

Mihai Apetrei
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+02:00)

Hi there.

For menus, you could use the "manual translation" option:
https://wpml.org/documentation/getting-started-guide/translating-menus/#option-1-translating-menus-manually

Or you could use CSS to hide those specific buttons, but that's a more custom approach where you might need a front-end developer to help you.

For the page content, you would either need to use the manual translation option (https://wpml.org/documentation/translating-your-contents/using-different-translation-editors-for-different-pages/) or, again, hide it with CSS.

I hope that you will find this answer helpful 🙂

Have an amazing rest of the weekend.

Mihai Apetrei

October 18, 2021 at 12:26 am #9806309

fengP

Hi Mihai,

I would like to CSS. Do you happen to know how to specify "if current language is Chinese" in css?

Thanks,
Emma

October 18, 2021 at 9:53 pm #9812899

Mihai Apetrei
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+02:00)

Hi Emma.

Sure, you should be able to target the <html> lang tag like this:

html[lang="zh-hans"] {css code}

Kind regards,
Mihai

October 23, 2021 at 1:12 am #9847365

fengP

Hi Mihai,

I am trying to add the code in "Custom CSS" in wordpress. Will I be able to check the language inside CSS code?

Thanks,
Emma.

October 23, 2021 at 2:17 am #9847761

Mihai Apetrei
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+02:00)

Hi there, Emma.

Adding that code to Appearances > Customizer > Custom CSS is a good place, indeed.

However, I'm not sure that I fully understand your question.

Can you please try to elaborate a bit more so that I can better understand what you are trying to find out?

Thank you! 🙂

Mihai

October 24, 2021 at 12:45 am #9849987

fengP

Hi Mihai,

Thanks for your reply.

I opened hidden link. Under section "Become a member", there are three level of membership. I clicked the block of one level of membership and inspect the source. I got the element: <div class="elementor-column elementor-col-33 elementor-top-column elementor-element elementor-element-62ecac0f" data-id="62ecac0f" data-element_type="column">

I tried to hide the above element by adding the following code under Appearances > Customizer > Custom CSS:

html[lang="zh-hans"]
{
.elementor-column.elementor-col-33.elementor-top-column.elementor-element.elementor-element-62ecac0f{
display: none;
}
}

however, the updates didn't take any effect. the membership level is still displayed when the current language is Chinese.

Any idea?

Thanks,
Emma

October 25, 2021 at 11:16 am #9856453

Mihai Apetrei
Supporter

Languages: English (English )

Timezone: Europe/Bucharest (GMT+02:00)

Hi Emma.

That is because the CSS is not good.

This is the correct form:

html[lang="zh-hans"] .elementor-column.elementor-col-33.elementor-top-column.elementor-element.elementor-element-43c630d7 {
    display: none !important;
}

Instead of 4 accolades, we have only 2.

That should solve this for you.

Mihai