如何在functions.php中添加谷歌字体

时间:2020-06-26 04:00:12

标签: wordpress google-fonts

嘿,我无法使它正常工作,这是我的代码

<?php 

//Adding the CSS and JS files

function HBUtheme_setup(){
    wp_enqueue_style('google-fonts', 'https://fonts.googleapis.com/css2?family=Raleway:ital,wght@0,300;0,400;0,600;0,700;1,300;1,400&family=Roboto:ital,wght@0,300;0,400;0,500;0,700;1,300;1,400&display=swap', false);
    wp_enqueue_style('fontawesome', 'https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css');
    wp_enqueue_style('style', get_stylesheet_uri(), NULL, microtime(), all);
    wp_enqueue_script('main', get_theme_file_uri('/js/main.js'), array(), microtime(), true);
}

add_action('wp_enqueue_scripts', 'HBUtheme_setup');

由于某种原因,我无法加载此字体。

0 个答案:

没有答案