2015-12-13 58 views
3

我正在開發一個WordPress主題;我導入了很多樣式表和一些Google字體,在MAC上一切都很好,但是當我在Windows上測試我的網站時,它沒有檢測到我的Google字體,我嘗試了幾種方法將它導入到我的functions.php文件中但結果相同。我已經在Edge,Chrome和Firefox上進行了測試,它也有相同的問題。谷歌字體不在Windows上呈現

我已經試過:

  1. 導入上style.css文件中使用@import - 沒有結果。
  2. 使用wp_register_stylewp_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和後兩者都可以在谷歌的字體。

你們可以幫我解決這個問題有點麻煩。

問候!

回答

0

內容呈現在iframe中。 iframe內沒有包含在<head>中的資源。當然,這包括所有的CSS,也包括字體。