wordpress:Mixed Content: The page at 'https://xxx/yyy/' was loaded over HTTPS, but requested an insecure script 'http://xxx/wp-includes/js/jquery/jquery.js?ver=1.11.3'. This request has been blocked; the content must be served over HTTPS. サイトをSSL化 (https)したときに出るエラー対処法

header.php 内の下記の箇所を

<?php wp_head() ?>

このコードに書き換えることで解決します。

<?php
   ob_start();
   wp_head();
  $wp_head_contents = ob_get_clean();
   $wp_head_contents = str_replace('http://', '//',$wp_head_contents);
   echo($wp_head_contents);
?>

しかし、これだとhttp://を全部書き換えてしまうので、jQueryの読み込みを//にするだけでも解決します!

wp_enqueue_script('jquery','//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js');

参考サイト

http://pikoro.revows.biz/2016/01/blog-7/

category cloud