Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
How to define or set different fonts as per the language?

Solution:
Use this format:

h1:lang(ckb), h2:lang(ckb), h3:lang(ckb), h4:lang(ckb), h5:lang(ckb), h6:lang(ckb) { 
  font-family: "Times New Roman", Times, serif !important;
}
p:lang(ckb) { font-family: Tahoma, Geneva, sans-serif !important; }

Change CKB to the language code you want to use.

100% of people find this useful.

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 6 replies, has 2 voices.

Last updated by karzanK 4 years, 11 months ago.

Assisted by: Riffaz.

Author Posts
May 18, 2019 at 6:43 pm #3839641

karzanK

Dear WPML support,
First of All thanks for your amazing product,

I want you to help me with CSS customization, please,

I have two languages:

1- English language LTR ( I don't have a problem with it you know I can control it from both theme customizer and Elementor pro as well).
and my fonts for english version are ( "Lato" and "Roboto")

2- Second language is Kurdish (Sorani) which is RTL,
I want you help me with how to customize custom font style and menu style as well.

custom font for the Kurdish language are :
("Noto Kufi Arabic") for h1, h2,h3,h4,h5,h6 and menu-s ( navigation menu, secondary menu)

("Noto Naskh Arabic") for Body and p (paragraph)s.
I have installed both of the above fonts and work in the customizer,

I tried these but doesn't worked for me:

Custom font:
https://wpml.org/forums/topic/split-different-fonts-for-different-languages/

Custom menu style:
https://wpml.org/forums/topic/how-can-i-custom-menu-style-for-each-language/

Thank you.

custom-font-for WPML-may-2019-GP-language-ckb.png
custom-font-for WPML-may-2019-GP.png
May 19, 2019 at 6:17 am #3840793

Riffaz

Hi,

Thank you for contacting WPML support.

Did you install the custom font you are referring to?
Are you able to select it in English site somewhere using your theme option?

If you sucessfully installed the font and set it as per your theme requirements when you define the css it should be effected somewhere and overridden by the other default fonts in your case but I do not see the font name anywhere in h3 in your site: hidden link

It's popins and robotto everwhere.

I found about google fonts for your theme: hidden link
It's better you check with your theme support about adding an Arabic font.
Add it.
Then try to assign it to wherever you want.

Let me know.

Regards,
Riffaz.

May 19, 2019 at 5:41 pm #3842183

karzanK

Hello,

Thanks for your reply,
Please, forget local font installation,

Simply I want you to help me with how to set different font style for Kurdish (sorani) which is differ than the default english one,

I mean when I changed the Kurdish (sorani) font style don't override the English one.
Each website has its own font style.

Example for Kurdish (sorani) I want to h1, h2, h3, h4, h5, h6 have ( font-family: "Times New Roman", Times, serif;)
and the rest body, p ( Tahoma, Geneva, sans-serif;)

any PHP code, or additional CSS will be needed to proceed it?

If I give you my login details will you be able to take a look for me please?

Thank you in advance.

wpml-custom-font.png
May 19, 2019 at 6:10 pm #3842247

karzanK

Just FYI, and please let me know,
please find my question on the attached screenshot.

custom-font-language-2.png
May 20, 2019 at 6:44 am #3843983

Riffaz

Hi,

Use this format:

h1:lang(ckb), h2:lang(ckb), h3:lang(ckb), h4:lang(ckb), h5:lang(ckb), h6:lang(ckb) { 
  font-family: "Times New Roman", Times, serif !important;
}
p:lang(ckb) { font-family: Tahoma, Geneva, sans-serif !important; }

I checked this in your site and it works: hidden link

Hopefully this will fix your issue.

Let me know your issue.

Regards,

May 20, 2019 at 9:03 am #3845397

karzanK

Hello Riffaz,

Thank you so much, it worked,

I appreciate your help!

main-menu-change font-wpml.png
This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.