ランディングページをWP化してほぼ完成しています。
お問い合わせページを「page.php」で作成しているのですが、httpで検索した際とhttpsで検索した際で
CSSのデザインが異なります。
(SSL化は完了していますのでリダイレクトされます)
原因がどうしてもわからないため、よろしくお願いします。
以下コードです。
(funtcitons.phpに書く必要がありそうですが、書き方がわからなかったので一旦head作って書いています)
page.php↓
<head> <?php if ( is_page() ): ?> <link rel="stylesheet" href="<?php echo get_template_directory_uri(); ?>/css/contact.css"> <?php endif; ?> <title>お問い合わせ</title> </head> <div class="wrapper"> <?php if(have_posts()):the_post(); ?> <main class="<?php echo esc_html($post->post_name); ?>"> <section class="section__form"> <!-- タイトル --> <h1><?php the_title(); ?></h1> <!-- 本文取得 --> <?php the_content(); ?> </section> </main> <?php endif; ?> </div> コード
contact.css→(httpの場合は適用される、httpsの場合は適用されない)
@charset "utf-8"; .wrapper{ margin-top: 40px; margin-left: 40px; } h1{ background-color: #f8f8f8; } コード
あなたの回答
tips
プレビュー