Skip Navigation

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

Problem:
The client needed the correct CSS code to apply a specific font for the Persian language on their website, after previously receiving incorrect information.
Solution:
We advised the client to use the CSS language selector

html[lang="fa-IR"]

for the Persian language. To apply the font across various elements like body, h1, h2, etc., the client should use the following code:

html[lang="fa-IR"] body { font-family: 'kalameh-fa' !important; }

If this solution does not resolve the issue or seems outdated, or if it does not apply to your case, we recommend opening a new support ticket. We also highly suggest checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. For further assistance, please visit our support forum at https://wpml.org/forums/forum/english-support/.

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.

Our next available supporter will start replying to tickets in about 3.15 hours from now. Thank you for your understanding.

Tagged: 

This topic contains 5 replies, has 2 voices.

Last updated by Mihai Apetrei 2 months ago.

Assisted by: Mihai Apetrei.

Author Posts
September 7, 2024 at 11:32 am #16151212

webs

Background of the issue:
I translated the site into Arabic according to your instruction and the code you sent. The code you sent is in the form html[lang="ar"] body { font-family: 'KalamehWeb' !important; } and it was responding on the site. Now, after some time, I want to translate the site into Farsi. My chosen font with the code html[lang="en"] body { font-family: 'kalameh-fa' !important; } does not apply.

Symptoms:
The chosen font for Farsi translation does not apply.

Questions:
Why is the chosen font for Farsi translation not applying?
Is there a different code needed for applying fonts to Farsi translations?

September 7, 2024 at 7:41 pm #16151752

Mihai Apetrei
Supporter

Languages: English (English )

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

Hi there.

For English, you need to use:


html[lang="en-US"]

instead of


html[lang="en"]

I hope that you will find this information helpful.

Mihai Apetrei

September 8, 2024 at 7:08 am #16152111

webs

I apologize for the typo that occurred in the previous ticket, I meant html[lang="fa"].

The main language of my site is English. So I don't need a code

What code should I use for the Persian language to apply the font on the site?

And also, as I said before, the font will be applied only by putting all the items of the different parts of the site, such as body h1 , h2 , etc., and the code will not be applied in the way you sent the code (html[lang="ar"])

September 10, 2024 at 11:28 am #16160876

webs

hello
I am looking forward to your respons still

September 10, 2024 at 9:17 pm #16163783

Mihai Apetrei
Supporter

Languages: English (English )

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

Hi there.

Sorry for the delay, it has been a pretty full queue in the past few days.

I would like to request temporary access (wp-admin and FTP) to your site to take a better look at the issue. You will find the needed fields for this below the comment area when you log in to leave your next reply. The information you will enter is private which means only you and I can see and have access to it.

Our Debugging Procedures

I will be checking various settings in the backend to see if the issue can be resolved. Although I won't be making changes that affect the live site, it is still good practice to backup the site before providing us access. In the event that we do need to debug the site further, I will duplicate the site and work in a separate, local development environment to avoid affecting the live site.

Privacy and Security Policy

We have strict policies regarding privacy and access to your information. Please see:
https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/

**IMPORTANT**

- Please make a backup of the site files and database before providing us access.

- If you do not see the wp-admin/FTP fields this means your post & website login details will be made PUBLIC. DO NOT post your website details unless you see the required wp-admin/FTP fields. If you do not, please ask me to enable the private box.

The private box looks like this: hidden link

I will be waiting for your response.

September 11, 2024 at 11:32 am #16166167

Mihai Apetrei
Supporter

Languages: English (English )

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

Thank you.

For persian, you have to use "fa-IR" - the beginning should look like this:

 html[lang="fa-IR"] 

example:

html[lang="fa-IR"] body { font-family: 'kalameh-fa' !important; } 
Screenshot 2024-09-11 at 14.30.06.png
September 17, 2024 at 7:04 am #16186304

webs

Thank you so much