Creating a Static WordPress Front Page
This is far from a difficult thing to do. It’s actually so easy, its ridiculous. But I see so many people installing plugins and doing really complicated page template hacks to get this right, that I think a post dedicated to this is justified. Here’s the 30 second trick to getting a static front page.
Every theme will have an index.php file. The index.php file is your home page. This page will have your loop, that will most often bring in your latest posts etc.
Find this line:
<? if (have_posts()) : while (have_posts()) : the_post(); ?>
and just above it add this line:
<? query_posts('page_id=5'); ?>
Note that ‘5′ can be changed to whatever page you want to be your home page.
What this does, is generate a specific query that the following loop will carry out. In this case, it will call the content from post_id=5.
Bear in mind that if you have a dynamic WP page list, you’ll probably want to exclude the page you created to be your home page from your normal page list. You can do this by adding the exclude argument to your page list call. Like so:
<? wp_list_pages('title_li=&sort_column=menu_order&exclude=5'); ?>
And presto, you have a static front page.



Thanks for the tip. I’ve never thought about doing it that way.
Another way you can have a static home page is to duplicate the index.php file and just rename it home.php.
WordPress in its series of checkoffs looks for any page in the template named home.php and if it finds one, automatically assigns it as the home page.
Nice tip Josh, thanks!
yeah, me either. i’m going to try this way tonight!
handyi fvyaxot mjfcgohq vkpgrqydm uqrydwf ahrdx ntrlizy
How do you modify that home.php then?
@Dillon – that template is used purely for your home page. so you can do whatever you need to do for your home page, on that home.php template…
Since WP 2.1 you have been able to set any WP page as a static home page from the dashboard.
Go to Settings|Reading and select ”Front page displays…A static page’. You can select any (existing) page from the drop-down box. I usually create a blank page called ‘Articles’ (‘Blog’ if you prefer) and use that for the ‘Posts page’.
Nice tip Josh, thanks!
It would be a better solution to apply that solution to home.php. If you site does not have an archives.php that the hacked index.php would make your site show only that page no matter what link you click. This is a instant thought that needs testing, however, this is how I would do it.
Yes! home.php is the best option
I usually use it on client’s site where I use WP as CMS and fill it with custom queries.