内容
Wordpressの自作テーマをブランクテーマのUnderscoresから作っています。
ChromeとFirefoxではサイドバーとフッターはcontentの外側に吐き出されているのですが、IEでだけ何故か更に中にある記事ループの中に入ってしまいます。
何度も確認しましたがcontent、primary、main、記事ループでdiv等の閉じ忘れはありませんでした。
この状態ではサイドバーとフッターまで記事ループのスタイルの影響を受ける為、contentの外側に吐き出されるようにするにはどうしたら良いでしょうか。
index.phpのソース
php
1<?php 2/** 3 * The main template file 4 * 5 * This is the most generic template file in a WordPress theme 6 * and one of the two required files for a theme (the other being style.css). 7 * It is used to display a page when nothing more specific matches a query. 8 * E.g., it puts together the home page when no home.php file exists. 9 * 10 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/ 11 * 12 * @package hogehoge 13 */ 14 15get_header(); 16?> 17 18 <div id="content" class="site-content"> 19 <div id="primary" class="content-area"> 20 <main id="main" class="site-main"> 21 22 <?php 23 if ( have_posts() ) : 24 25 if ( is_home() && ! is_front_page() ) : 26 ?> 27 <header> 28 <h1 class="page-title screen-reader-text"><?php single_post_title(); ?></h1> 29 </header> 30 <?php 31 endif; 32 33 /* Start the Loop */ 34 while(have_posts()):the_post(); $counter++; 35 36 get_template_part( 'template-parts/kijiloop', get_post_type() ); 37 38 endwhile; 39 40 the_posts_navigation(); 41 42 else : 43 44 get_template_part( 'template-parts/content', 'none' ); 45 46 endif; 47 ?> 48 49 </main> 50 </div> 51 </div> 52 53<?php get_sidebar(); ?> 54<?php get_footer(); ?>
現在の状態
互換表示はチェックを外し、header.phpに<meta http-equiv="X-UA-Compatible" content="IE=edge"/>も入れてある状態です。
回答3件
あなたの回答
tips
プレビュー