HOW-TO: Create a static home page

January 8th, 2006

A little example of how easy it is to set up a static home page in WordPress.

First of all, create the home page like any other WordPress page using using Write -> Write Page. Give the page a post-slug of home. Test that it looks ok.

You now need to force this page to appear whenever users access the URL of your site. If you have a file called home.php in your current theme, WordPress will use this whenever users go to your home page. So, if you are using the default WordPress theme, go to the wordpress/wp-content/themes/default directory, and copy page.php to home.php.

You now need to force the home.php page to always display your home page. Edit home.php using Presentation -> Theme Editor, and add in the new line (second line below):

<?php get_header(); ?>
<?php query_posts(‘pagename=home’) ?>

This tells WordPress to only display the page with the page-slug of home on this page. Press Update File to save your new home page.

Now that wasn’t hard, was it?