Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/265.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何将“拉丁扩展”添加到WordPress主题的php查询中?_Php_Wordpress_Webfonts_Google Font Api - Fatal编程技术网

如何将“拉丁扩展”添加到WordPress主题的php查询中?

如何将“拉丁扩展”添加到WordPress主题的php查询中?,php,wordpress,webfonts,google-font-api,Php,Wordpress,Webfonts,Google Font Api,我的头衔并不能说明什么。所以我会尽量澄清的。我使用的是wordpress主题,它预装了谷歌字体。但是,包含的字体php不包含拉丁扩展选项。我应该如何添加&subset=拉丁语,拉丁语ext 守则如下: foreach($googlefonts as $googlefont) { if(!in_array($googlefont, $default)) { $themename_customfont = str_replace(' ', '+', $googlefont). ':

我的头衔并不能说明什么。所以我会尽量澄清的。我使用的是wordpress主题,它预装了谷歌字体。但是,包含的字体php不包含拉丁扩展选项。我应该如何添加&subset=拉丁语,拉丁语ext

守则如下:

foreach($googlefonts as $googlefont) {

if(!in_array($googlefont, $default)) {
        $themename_customfont = str_replace(' ', '+', $googlefont). ':300,300italic,400,400italic,700,700italic,900,900italic|' . $themename_customfont;
}
}

if ($themename_customfont != "") {  

function google_fonts() {       
    global $themename_customfont;       
    $protocol = is_ssl() ? 'https' : 'http';
    wp_enqueue_style( 'themename-googlefonts', "$protocol://fonts.googleapis.com/css?family=". substr_replace($theretailer_customfont ,"",-1) . "' rel='stylesheet' type='text/css" );
}
add_action( 'wp_enqueue_scripts', 'google_fonts' );