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.
- Duplicate the page.php file of your theme and name it home.php
- Right before the line that starts with “< ?php if (have_posts())...", add this line: "< ?php query_posts('pagename=home'); ?>“
- 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.
Karen | June 22, 2006,
wow, how simple is that?
thanks for the great tip, Joe!
James John Malcolm (AkaXakA) | July 2, 2006,
That, dear sir, is excellent!
-joe | July 7, 2006,
Hi-This is a Wordpress them. I thought it was a regular design. Where do I go to download? Thanks -joe
LobsterMan | July 7, 2006,
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.
Steve | August 6, 2006,
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?
LobsterMan | August 7, 2006,
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.Brother Dash | August 27, 2006,
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
Reed | September 11, 2006,
room S
centris . ro » Wordpress: Cum sa faci prima pagina a blogului statica | November 2, 2006,
[...] Urmati instructiunile din articolul Create a static homepage for Wordpress [...]
Rudd-O | November 12, 2006,
This technique damages the blog post list. I devised a new two-step one.
LobsterMan | November 12, 2006,
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.
yrlenstiol11 | December 5, 2006,
studios
Move WordPress blog to inner page- This ‘N That | December 18, 2006,
[...] 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: [...]
T-Man | December 24, 2006,
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.
LobsterMan | December 24, 2006,
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.
T-Man | December 24, 2006,
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.
Batusai | December 26, 2006,
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.
LobsterMan | December 28, 2006,
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
Brian Shoff | January 3, 2007,
Nice, simple, to the point, thanks!
GarageGrafix.com » Blog Archive » How I fixed my Wordpress Permalinks | January 13, 2007,
[...] 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. [...]
Dawn | February 3, 2007,
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
LobsterMan | February 3, 2007,
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.
Sunlust Designs | August 18, 2008,
Great, so simple, I’m gonna use it right now.
Dragon Blogger | September 21, 2008,
What are the benefits for doing it this way vs just using WP Admin -> Options and setting the front page that way? Or was this hack for older versions of wordpress?
Nate | October 5, 2008,
As Dragon stated, if you are using WP 2.1 or later, there is no need to futz about with the code like this.
Toby | February 11, 2009,
With the newer versions of wordpress it is easier to create a static homepage. Just create two pages in the page manager; one titled “home” and the other titled “blog”. Then goto Dashboard => Settings => Reading and select static homepage and choose “home” for the homepage and the blog posts to be directed to the “blog” page. It what I have done on my website.
Lance | March 22, 2009,
Cool, thanks for the tip! I’ve been looking for this
Dileep | April 14, 2009,
thanks…..i ve been looking for it for a quite a some tme now…
Dileep | April 14, 2009,
But this doesnt work for all the themes
James | April 20, 2009,
Even if it doesn’t cover all avenues, simple is great. Fantastic idea!
Only one thing though. Does anyone know how to create multiple content both dynamic and static on this static page?
Cai | December 22, 2009,
Thank you very much for the explanation.