3
我正在開發一個WordPress主題;我導入了很多樣式表和一些Google字體,在MAC上一切都很好,但是當我在Windows上測試我的網站時,它沒有檢測到我的Google字體,我嘗試了幾種方法將它導入到我的functions.php
文件中但結果相同。我已經在Edge,Chrome和Firefox上進行了測試,它也有相同的問題。谷歌字體不在Windows上呈現
我已經試過:
- 導入上
style.css
文件中使用@import
- 沒有結果。 - 使用
wp_register_style
和wp_enqueue_style
註冊樣式 - 無結果。
我會在下面留下我的functions.php
文件。
function wp_bulldoezer_styles() {
wp_register_style('raleway', 'http://fonts.googleapis.com/css?family=Raleway:400,300,500,600,700,800');
wp_register_style('hind', 'http://fonts.googleapis.com/css?family=Hind:400,300,500,600,700');
$query_args = array(
'family' => 'Raleway:400,300,500,600,700,800|Hind:400,300,500,600,700',
);
wp_register_style('google-fonts', add_query_arg($query_args, "//fonts.googleapis.com/css"), array(), null);
wp_enqueue_style('google-fonts');
wp_enqueue_style('raleway');
wp_enqueue_style('hind');
}
add_action('wp_enqueue_scripts', 'wp_bulldoezer_styles');
在我的CSS文件:
@import url(http://fonts.googleapis.com/css?family=Raleway:400,300,500,600,700,800);
@import url(http://fonts.googleapis.com/css?family=Hind:400,300,500,600,700);
您可以測試這個URL的網站,我要導入的字體是Raleway和後兩者都可以在谷歌的字體。
你們可以幫我解決這個問題有點麻煩。
問候!