使用 wpml 和 elementor 在 wordpress 上更改字体系列 css 语言

问题描述 投票:0回答:1

我在 elementor pro 和 wpml 中使用 wordpress,我使用英语和阿拉伯语,对于阿拉伯语,我想使用 Elementor 处理的另一种字体系列(谷歌字体),但是当我尝试实现它时它不起作用。 我遵循 wpml ro elementor(重新生成 css)的所有建议,在主题中添加自定义 css => 自定义或在 wpml 语言菜单 => Aditional CSS

html:lang(ar) * {
  font-family: "Noto Kufi Arabic",Arial,Lucida,sans-serif!important; 
}

html:lang(ar) {
  font-family: "Noto Kufi Arabic",Arial,Lucida,sans-serif!important; 
}

html[lang="ar"] * {
 
font-family: 'Noto Kufi Arabic',Arial,Lucida,sans-serif !important;
    color:red!important;
 
}

当我更改文本颜色时它正在工作,这意味着检测到 css 自定义

那为什么字体没有改变,我试过其他字体都没有成功

真正奇怪的是即使在计算中我们看到正确的字体但没有显示!

wordpress elementor custom-font wpml
1个回答
0
投票

所以,当你有 elementor 时,所有嵌入的字体都没有嵌入到 wordpress 中,所以我不得不在自定义 style.css 中添加字体并添加自定义 css。

在子主题 style.css 添加:

@import url('https://fonts.googleapis.com/css2?family=Noto+Kufi+Arabic:wght@400;700&display=swap');

html[lang="ar"] * {
 
font-family: "Noto Kufi Arabic",sans-serif !important;
 
}
© www.soinside.com 2019 - 2024. All rights reserved.