我正在开发一个wordpress主题 . 我正在为特定页面制作自定义主题 .

我创建了一个标识为“home”的“Home”页面 . 我用这个循环创建了一个page-home.php文件:

<?php get_header();
get_topmenu(); ?>

    <div class="catch"></div>

    <div id="primary" class="content-area page-home">
        <div id="content" class="site-content" role="main">
            <?php /* The loop */ ?>
            <?php if(have_posts()) : ?>
            <?php while (have_posts()) : the_post(); ?>

                <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
                    <h1 class="entry-title"><?php the_title(); ?></h1>

                    <div class="entry-content">
                        <?php the_content(); ?>
                    </div><!-- .entry-content -->
                </article><!-- #post -->

                <?php comments_template(); ?>
             <?php endwhile; ?>
            <?php endif; ?>

        </div><!-- #content -->
    </div><!-- #primary -->
    PAGE HOME.PHP


<?php get_sidebar(); ?>
<?php get_footer(); ?>

但是这样做,当我打电话给我时,q = home,我的所有页面都显示在循环中,而不仅仅是“主页”页面......获取“主页”页面的最简洁方法是什么?