Browse Source

google字体修改cdn

master
humorwang 4 years ago
parent
commit
b2aa125d81
  1. 4
      functions.php
  2. 2
      functions/js/customizer-preview.js

4
functions.php

@ -286,7 +286,7 @@ function cordero_fonts_url() {
$fonts_url = add_query_arg( array(
'family' => urlencode( implode( '|', array_unique($fonts) ) ),
'subset' => urlencode( $subsets ),
), '//fonts.googleapis.com/css' );
), '//fonts.geekzu.org/css' );
return esc_url_raw($fonts_url);
} else {
return;
@ -355,7 +355,7 @@ function cordero_editor_fonts_url() {
$fonts_url = add_query_arg( array(
'family' => urlencode( implode( '|', array_unique($fonts) ) ),
'subset' => urlencode( $subsets ),
), '//fonts.googleapis.com/css' );
), '//fonts.geekzu.org/css' );
return esc_url_raw($fonts_url);
} else {
return;

2
functions/js/customizer-preview.js

@ -180,7 +180,7 @@ function cordero_font_bind( to, style_class ) {
if ( to == '' || to == 'Arial, Helvetica, sans-serif' || to == 'Impact, Charcoal, sans-serif' || to == '"Lucida Sans Unicode", "Lucida Grande", sans-serif' || to == 'Tahoma, Geneva, sans-serif' || to == '"Trebuchet MS", Helvetica, sans-serif' || to == 'Verdana, Geneva, sans-serif' || to == 'Georgia, serif' || to == '"Palatino Linotype", "Book Antiqua", Palatino, serif' || to == '"Times New Roman", Times, serif' ) {
} else {
var googlefont = encodeURI(to.replace(" ", "+"));
jQuery('head').append('<link href="//fonts.googleapis.com/css?family=' + googlefont + '" type="text/css" media="all" rel="stylesheet">');
jQuery('head').append('<link href="//fonts.geekzu.org/css?family=' + googlefont + '" type="text/css" media="all" rel="stylesheet">');
to = to.substr(0, to.indexOf(':'));
to = "'" + to + "'";
}

Loading…
Cancel
Save