我的网站使用的是Cherry框架主题。我将站点改为使用https,但仍然有一个jquery脚本,它显然是硬编码的,因为它仍然使用http。
我已经搜索了主题目录和cherry插件目录中的所有文件,但从未找到该行脚本。
我还能用https覆盖它吗?
我的网站使用的是Cherry框架主题。我将站点改为使用https,但仍然有一个jquery脚本,它显然是硬编码的,因为它仍然使用http。
我已经搜索了主题目录和cherry插件目录中的所有文件,但从未找到该行脚本。
我还能用https覆盖它吗?
如果脚本使用wp_enqueue_script
(正如“应该”的那样)然后您可以直接使用查找和替换匹配来修改标记,以使用script_loader_tag
过滤器:
add_filter(\'script_loader_tag\', \'custom_https_fix\', 10, 2);
function custom_https_fix($tag, $handle) {
$match = \'jquery.script.js\'; // replace with actual script filename
if (strstr($tag, $match)) {$tag = str_replace(\'http://\', \'https://\', $tag);}
return $tag;
}
例如,在我的管理页面,即仪表板侧://This is hidden until search results come back //which will be inserted as innerHTML within #searchResults <div id=\"hideShow\"> <h2>Search Results</h2> <div id=\"searchResults\"></div> &