内容目录
1、网站根目录\wp-config.php文件在** @package WordPress*/
后添加代码
/** WordPress Administration API: Includes all Administration functions. */
$_SERVER['HTTPS'] = 'on';define('FORCE_SSL_LOGIN', true);define('FORCE_SSL_ADMIN', true);
2、网站根目录文件\wp-includes\functions.php文件在require_once ABSPATH . 'wp-admin/includes/admin.php';
后添加代码。
/** WordPress Administration API: Includes all Administration functions. */
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); }
3、此设置有问题,在站点的基础设置中更改,不需要www.
部分,代码直接删掉或者注释。