Create a static homepage for WordPress

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.


22 Responses to “Create a static homepage for WordPress”

  1. Karen says:

    wow, how simple is that?

    thanks for the great tip, Joe! :)

  2. That, dear sir, is excellent!

  3. -joe says:

    Hi-This is a Wordpress them. I thought it was a regular design. Where do I go to download? Thanks -joe

  4. LobsterMan says:

    This site is based on Andreas01 by Andreas Viklund, I’m pretty sure he offers his version of the port (much better then mine ;) ) on his site.

  5. Steve says:

    thanks for the tip. it worked on our site well. one question…i created a page called “welcome page” (with the home slug) to be the static home page. now however i have two links in my sidebar–one for “home” and one for “welcome center”. both point to the same page. how do i delete the default “home” link in the sidebar?

  6. LobsterMan says:

    I don’t know what theme you’re using, but normally the home link is a static link before the wp_list_pages() function. it should look like this < a href="< ?php bloginfo('home'); ">Home< /a> you can delete this line, of alternatively add an exclude argument to the wp_list_pages() function so that it doesn’t list the “welcome page” and use the home link instead. You can find out more about the wp_list_pages() function here.

  7. Brother Dash says:

    By far the best option. Why are all of the google searches turning up this convoluted code happy options? And that filosofo plug in didn’t work at all for me. Why use the plug in when your option is so much easier anyway. Thanks alot…it worked like a charm. It’s not up on my site now because I’m still re-designing it but I tested it out and I’ll go with it. Thanks alot

    Brother Dash

  8. [...] Urmati instructiunile din articolul Create a static homepage for Wordpress [...]

  9. Rudd-O says:

    This technique damages the blog post list. I devised a new two-step one.

  10. LobsterMan says:

    Yes, I guess I need to post a part 2, but there’s other ways of getting around the list pages problem, like excluding the home page, or listing it’s children pages only.

  11. yrlenstiol11 says:

    studios

  12. [...] OK, so i’ve already showed you how to put a static page on your wordpress home page. But what if you want a blog, but you want it showing on an inner page? Here’s the solution: [...]

  13. T-Man says:

    OK this question is liable to get me banned from this web site due to the level of stupidity I am about to display. In fact, I may even ban myself. But here goes:

    When I create this static page, complete with all of nice little welcome stuff and thanks for visiting BS, what link does the person click to enter the blog proper? What will the php code for the link look like? I will want them to read the short welcome letter, but then get busy looking at all my brilliant posts.
    :D

  14. LobsterMan says:

    Nothing stupid about that question. read This article to find out how to do this.
    Actually, I think I’ll add a link to the post.

  15. T-Man says:

    OK I tried your suggestion regarding the inner page, coupled with this suggestion for the static page, and it has broke parts of my site. I posted a comment in the inner page post. :)

  16. Batusai says:

    Hallo,

    thank you very much for your work. I use the theme ‘X Blog’ and would like to use it for the web itself, but I can’t get this point:
    “3.- Create a page in the wordpress admin, and make sure that it’s post-slug is “home“”.
    Could you give me an example? Could I use any of the existing php files as I did with the first point of your explanation?

    Thanks in advance.

  17. LobsterMan says:

    You need to create a page through the wordpress admin area, not manually. the post slug is one of the options on the right side when creating a page through the wp admin

  18. Brian Shoff says:

    Nice, simple, to the point, thanks!

  19. [...] Like most newbie’s to wordpress I went and installed a variety of plungin’s to improve the way my site looks and functions not realizing the whole picture. One of the first things I wanted to do to my site was to have a static home page and use my blog categories for my navigational structure so I installed a plugin called Filosofo home-page control developed by Austin Matzko. I could never get this plugin to do what I wanted, but I never de-activated it. I did get the result that I needed from a different source, find it HERE . I followed this guys steps to obtain the static home page that I wanted. Now back to the permalinks. [...]

  20. Dawn says:

    Okay, I’ve tried this solution as well as the one for the blog.php instructions you have, and it does not work.
    I’m using WP 2.1. Are these instructions valid for this version?

    Dawn

  21. LobsterMan says:

    There’s no need for any hacks for WordPress 2.1 – Just go to WP Admin -> Options -> Reading and set which page you want to use for the home page, and which page you want to use as the blog page.

Leave a Reply

bottom