Notice: Undefined index: scheme in /www/wwwroot/qq.wanuse.com/wp-includes/canonical.php on line 751

Notice: Undefined index: host in /www/wwwroot/qq.wanuse.com/wp-includes/canonical.php on line 716

Notice: Undefined index: host in /www/wwwroot/qq.wanuse.com/wp-includes/canonical.php on line 727

Notice: Undefined index: host in /www/wwwroot/qq.wanuse.com/wp-includes/canonical.php on line 730

Notice: Undefined index: scheme in /www/wwwroot/qq.wanuse.com/wp-includes/canonical.php on line 751
wordpress开启ssl后css无法加载的解决 - DDD网络科技
使用互联网记录分享(Wide Area Network use :更好地使用互联网。)
wordpress开启ssl后css无法加载的解决

wordpress开启ssl后css无法加载的解决

方法一:找到functions.php,添加如下代码:

wordpress开启ssl后css无法加载的解

add_filter('script_loader_src', 'agnostic_script_loader_src', 20,2);

function agnostic_script_loader_src($src, $handle) {

    return preg_replace('/^(http|https):/', '', $src);

}
  
add_filter('style_loader_src', 'agnostic_style_loader_src', 20,2);

function agnostic_style_loader_src($src, $handle) {

    return preg_replace('/^(http|https):/', '', $src);

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注