我收到了一個錯誤,並且網站在無緣無故被阻止。SSL Google字體錯誤
因爲它是一個小型站點,我強制所有頁面都處於SSL狀態。而收到此錯誤:
[blocked] The page at ' https://www.splitapartments.co/ ' was loaded over HTTPS, but ran insecure content from ' http://fonts.googleapis.com/css?family=Open+Sans:400,800,300,700 ': this content should also be loaded over HTTPS.
的WordPress主題排隊谷歌字體安全模式:
function dt_get_google_fonts($font = '', $effect = '') {
if (! $font) {
return;
}
if (array_key_exists($effect, dt_get_web_fonts_effects())) {
$effect = '&effect=' . esc_attr($effect);
} else {
$effect = '';
}
$protocol = "http";
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
$protocol = "https";
}
?>
<link rel="stylesheet" type="text/css" href="<?php echo $protocol; ?>://fonts.googleapis.com/css?family=<?php echo str_replace(' ', '+', $font) . $effect; ?>">
<?php
}
function dt_make_web_font_uri($font, $effect = '') {
if (!$font) {
return false;
}
// add web font effect
if (function_exists('dt_get_web_fonts_effects')) {
if (array_key_exists($effect, dt_get_web_fonts_effects())) {
$effect = '&effect=' . esc_attr($effect);
} else {
$effect = '';
}
} else {
$effect = '';
}
$protocol = is_ssl() ? "https" : "http";
$uri = $protocol . '://fonts.googleapis.com/css?family=' . str_replace(' ', '+', $font) . $effect;
return $uri;
}
我完全搞不清楚爲什麼會出現這種情況。我嘗試了所有可以找到的解決方案,但沒有任何效果。
請添加錯誤消息,以便人們可以協助您。如果你進入你的wp-config文件並啓用WP DEBUG模式爲真,它會給你錯誤信息。 – jagmitg