Skip Navigation

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

Problem:
The client wants to configure custom fonts in the general settings for each language, rather than for each element through the page builder.

Solution:
If you are experiencing this, we recommend using CSS code to apply different fonts for each translation. Here is an example of how to do it:

html[lang="ar"] {font-family: "Cyrillic Barlow Condensed Reg" !important; font-size: 20px !important; font-weight: 600 !important;}

This code is just an example and depending on the design of your site, you will need to apply CSS code and adjust the values.

For example, if you want to target all paragraphs on the site, you would include the

tag as follows:

html[lang="ar"] p{font-family: "Hoverla Font ENG" !important; font-size: 24px !important;}

If you want to target more HTML tags, you can use something like this:

html[lang="ar"] p, html[lang="ar"] a, html[lang="ar"] h1{font-family: "Hoverla Font ENG" !important; font-size: 24px !important;}

Please note that custom CSS is outside the scope of our Support guidelines, but we still wanted to share with you some examples that you can follow.

If the solution provided turns out to be irrelevant, either because it is outdated or does not apply to your case, we suggest opening a new support ticket. We strongly recommend that you review the known issues, check the version of the permanent fix, and confirm that you have installed the latest versions of themes and plugins.

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 2.91 hours from now. Thank you for your understanding.

Tagged: 

This topic contains 1 reply, has 2 voices.

Last updated by Mihai Apetrei 6 months, 3 weeks ago.

Assisted by: Mihai Apetrei.

Author Posts
April 27, 2024 at 12:26 pm #15572861

webs

I want to set different and custom fonts in general settings for each language. Rather than setting it up for each item through the page builder
Thank you for your guidance

April 27, 2024 at 9:05 pm #15573237

Mihai Apetrei
Supporter

Languages: English (English )

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

Hi there.

In order to use different fonts for each translation you could use CSS code as in the example below:

html[lang="ar"] {font-family: "Cyrillic Barlow Condensed Reg" !important; font-size: 20px !important; font-weight: 600 !important;}

The code above is just an example and depending on your site layout you’ll need to apply the CSS code and just play with the values.

For example, if you want to target all the paragraphs inside the site, this means that we will need to add into the mix the <p> tag (which is the HTML tag for the paragraph).

html[lang="ar"] p{
font-family: "Hoverla Font ENG" !important;
font-size: 24px !important;
}

If you would like to target more HTML tags, you can use something like this:

html[lang="ar"] p, html[lang="ar"] a, html[lang="ar"] h1{
font-family: "Hoverla Font ENG" !important; 
font-size: 24px !important;
}

Please note that custom CSS is out of the purpose of our Technical Support guidelines, but I still wanted to share with you some examples that you can follow.

Kind regards,
Mihai Apetrei