I have my front page set to a static page and am trying to build my custom template. How do I actually show the selected front page in front-page.php? I have googled and googled but can’t seem to figure out how to do it.
The front-page.php actually loads like it should, but I can’t seem to find documentation on exactly how to show the page that is assigned as the static home page. Any suggestions?
I have tried
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', 'page' ); ?>
<?php comments_template( '', true ); ?>
<?php endwhile; // end of the loop. ?>
but that didn’t seem to work…
Your static page uses a page template (usually page.php for the default template)
You can create a new one for the homepage if you wish. see : Creating_Your_Own_Page_Templates copy
page.php
tohomepage.php
and change the template nameExample template (homepage.php) :
If its a static page, I should not use a loop.
First, take a look to topic to show something only on home page. a related question is WordPress Post Thumbnail Issue (Only 1 thumbnail on frontpage). Also, it can be useful how to create a static front page in wordpress.
I was missing something obvious. The loop I was using I had copied out of wordpress template. It actually called another template file. What I should have used was: