home.phpが表示されない(page.phpが優先される?)
-
ある固定ページをフロントページ(トップページ)にして(表示設定で選択済み)、サーバーにhome.phpと、その他の固定ページのためにpage.phpをアップしました。
index.phpはそのまま(home.phpとまったく同じ内容)です。
これでトップページはhome.phpで表示される…のかと思ったら、表示されません。かわりにpage.phpで表示されてしまいます。
page.phpをサーバーから削除したら、正しいトップページ内容が表示されましたが、これはhome.phpを読んでいるのか、たんにindex.phpで表示されているだけなのか、不明です。
原因が分からず、困っています。
どなたかアドバイスよろしくお願いします。home.phpの中身
<?php get_header(); ?> <div id="main"> <?php if(have_posts()): while(have_posts()): the_post(); ?> <h2><?php the_title(); ?></h2> <?php the_content(); ?> <?php endwhile; endif; ?> </div><!--the end of main --> <div id="sub"> <div id="newsfeed"> <h2>What's New</h2> <p>1ニュース記事が入りますニュース記事が入ります</p> <p>2ニュース記事が入りますニュース記事が入りますニュース記事が入りますニュース記事が入りますニュース記事が入ります</p> <p>3ニュース記事が入ります</p> <p>4ニュース記事が入りますニュース記事が入りますニュース記事が入りますニュース記事が入ります</p> </div><!-- the end of newsfeed --> </div><!-- the end of sub --> <?php get_footer(); ?>
page.phpの中身
<?php get_header(); ?> <div id="main"> <?php if(have_posts()): while(have_posts()): the_post(); ?> <h2><?php the_title(); ?></h2> <?php the_content(); ?> <?php endwhile; endif; ?> </div><!--the end of main --> <div id="sub"> </div><!-- the end of sub --> <?php get_footer(); ?>
5件の返信を表示中 - 1 - 5件目 (全5件中)
5件の返信を表示中 - 1 - 5件目 (全5件中)
- トピック「home.phpが表示されない(page.phpが優先される?)」には新たに返信することはできません。