我在 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 自定义
那为什么字体没有改变,我试过其他字体都没有成功
所以,当你有 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;
}