本サイトでは、twenty seventeenをベースにしてデザインしているが、sslでhttpをhttpsにしたとき、トップページではcssが効くのに、サブページではcssが効かなかったので、修正した。参考サイトの丸パクリなんだけど。
まずは、wp_head();のところ
wp_head();
を下記に
ob_start();
wp_head();
$wp_head_contents = ob_get_clean();
$wp_head_contents = str_replace('http://', 'https://', $wp_head_contents);
echo($wp_head_contents);
つぎに、wp_footer();のところ
wp_footer();
を下記に
ob_start();
wp_footer();
$wp_footer_contents = ob_get_clean();
$wp_footer_contents = str_replace('http://', 'https://', $wp_footer_contents);
echo($wp_footer_contents);
cssが効くようになりました。