Create a static homepage for WordPress

Written by LobsterMan | Thursday, August 10th, 2006
, ,

I’ve been asked about this a few times lately, I know there’s a plugin that does this, but this is the most simple way, by far.

  1. Duplicate the page.php file of your theme and name it home.php
  2. Right before the line that starts with “< ?php if (have_posts())...", add this line: "< ?php query_posts('pagename=home'); ?>
  3. Create a page in the wordpress admin, and make sure that it’s post-slug is “home

Done. Now the page called “home” will show as your homepage.

Related Posts:

4 Responses to “Create a static homepage for WordPress”

  1. Statisk förstasida i WordPress » blogg.ahlund.se Says:

    [...] Via: Attackr [...]

  2. bcwood Says:

    Thanks for the tip LobsterMan. I’ve used the plugin you refer to on several site, but the method you describe is much simpler.

  3. slickopr1 Says:

    Does this work in WordPress 2.1? I tried it and I couldn’t get it to work.

  4. Sean Says:

    @SLICKROPR1: In WordPress 2.1 this will not work because they added in the functionality to do static pages. It’s in your dashboard area.

Leave a Reply

 
Stop Censorship