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 hassanA-15 3 months ago.

Assigned support staff: Radu.

Author Posts
July 9, 2019 at 11:20 am #4170081

hassanA-15

I am trying to: Add a local webfont for all languages. I tried to add it to the wordpress customizer in "additional css" and in the theme's css file. Both works for the standard language, but not the second one.

Link to a page where the issue can be seen: hidden link (switch between english and german to see the difference. German is how it is supposed to look like)

I expected to see: The webfont working in all languages

Instead, I got: The webfont only working with the standard language

July 9, 2019 at 2:09 pm #4171685

Radu
Supporter

Languages: English (English )

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

Hey Hassan,

Can you tell me how did you load the fonts on your website, please? I checked the English page and I could see that the console shows some errors saying that the fonts were not loaded (see the attached screenshot). I think that the path of the fonts is not the right one. This is why I asked for more details about the way you added the font to your website.

Thanks,
Radu

July 9, 2019 at 2:49 pm #4172005

hassanA-15

Hi Radu,

they are in a "fonts" folder in the wordpress root folder, so on the same level as wp-content, wp-admin etc. And it works with the german version.

July 10, 2019 at 4:49 am #4176069

Radu
Supporter

Languages: English (English )

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

Hey Hassan,

I understand that everything works on the german version but, as I mentioned in my previous message, I think that there's something wrong with the way that the font is loaded. This is why it would be great if you could give me access to the dashboard and let me know how did you load the font to your website. You added the files to the root of the WordPress install but what is the code that you added to the website? That's what I need to check.
The next reply is private so you can safely send me the dashboard credentials.

Thanks,
Radu

July 10, 2019 at 12:19 pm #4180075

Radu
Supporter

Languages: English (English )

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

Hey Hassan,

Have you managed to sort this out in the meantime? I'm asking this because I was checking the English version of your website and the Forum font seems to be working well now.

Thanks,
Radu

July 10, 2019 at 12:41 pm #4180317

hassanA-15

Hi Radu,

no, I didn’t change anything.
The fonts works on the English home page, but it doesn’t work on all other English pages.

July 11, 2019 at 9:17 am #4187861

Radu
Supporter

Languages: English (English )

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

Hey Hassan,

As I can see, on this page hidden link, the website is trying to load the fonts from the hidden link folder or even hidden link. You can see all the paths when checking the console error. In this case, can you try to use absolute path for the fonts instead of relative? You'd need to change the the urls from this
url('../fonts/forum-v9-latin-regular.ttf')
to this
url('hidden link')
You can give this a try and tell me how things work this time.

Thanks,
Radu

July 18, 2019 at 2:19 pm #4239557

hassanA-15

The solution isn't very elegant, but works fine. My issue is resolved now. Thank you!