Custom theme : page-home.php displays all posts
-
Hello,
I’m developping a wordpress theme. I’m making a custom theme for a specific page.
I created a “Home” page with the identifier “home”. I created a page-home.php file, with this loop:
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(); ?>But doing this, I’ve got ALL my pages displayed in the loop, and not just the “home” page… What is the cleanest way to get just the “Home” page ?
Thanks for your help to a theme-developpement newbie 😉
Maxime
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
The topic ‘Custom theme : page-home.php displays all posts’ is closed to new replies.