WordPress Secrets: The Real Ultimate Static Front Page

Quick Note: If you are looking for the source, find it here.

With WordPress, there have been so many attempts to make the best static front page. Most variations have included plugins that change the default behavior of the home page to display a pre-selected WordPress page. However, the Turbocharged blog showcases a new technique that uses a theme’s home.php template, and even allows you to add pure PHP code to it. Rudd-O’s solution is to place this code into the home.php file:

<?php $homepage = get_settings('siteurl')."/home/";
global $wp;
$wp_received_argument = false;
foreach ($wp->query_vars as $k=>$v) if ($v) $wp_received_argument = true;
if ($wp_received_argument) require(TEMPLATEPATH . "/index.php");
else { wp_redirect($homepage);
exit(); } ?>

Simple and quick, this will redirect to a static WP page with a slug of ‘home’. However, this technique doesn’t really provide much flexibility as to what you can do with your homepage, as you are simply limited to the tools provided by WordPress’s editor and any installed plugins.

What the code you see above does is check for any parameters passed in the URL that tell WordPress what to display in the resulting page. If parameters exist, the normal index.php template will be used. If not, the visitor will be redirected to your static page.

What I have done is extend this code so that instead of redirecting to a WP static page, the user will see the output of code run in the home.php file. I replaced the redirection code with a custom made layout, which includes a slimmed-down WP Loop, the code that displays post listing pages. This is my version (I’m going to omit the large portions of irrelevant code):

<?php get_header();
//$homepage = get_settings('siteurl')."/home/"; - from original code
global $wp; $wp_received_argument = false;
foreach ($wp->query_vars as $k=>$v) if ($v) $wp_received_argument = true;
if ($wp_received_argument) require(TEMPLATEPATH . "/index.php");
else { //wp_redirect($homepage); - from original code
//exit(); - from original code get_header();
?> <div id="content">
<?php include_once(TEMPLATEPATH.'/intro.php');?>
<!-- Primary content: Stuff that goes in the primary content column (by default, the left column) -->
<div id="primarycontainer">
<div id="primarycontent">
<div id="contentarea">
<!-- Primary content area start -->
<table summary="Layout for Educated home page" width="100%">
<tr>
...
<td style="width: 50%; vertical-align: top">
<h4 style="border-bottom-color: #070000; border-bottom-width: 1px; border-bottom-style: solid">Latest Updates</h4>
<ul>
<?php //begin the loop if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<li>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">
<?php the_title(); ?>
</a><br />
<span class="date">
<?php the_time('F jS, Y') ?>
</span>
</li>
<?php endwhile; else: ?>
<p>
<?php _e('Sorry, no posts.'); ?>
</p>
<?php endif; ?>
</ul>
</td>
</tr>
</table>
</div>
<!-- primarycontent end -->
</div>
<!-- primarycontainer end -->
</div>
<!--content end -->
<?php get_sidebar();
get_footer(); }?>

Please do not copy this directly. I omitted various portions of important code that you may need for the code to work on your site. Please see the companion article for a sample version you can download and play with and instructions.

What this does is imitate the index.php template: it shows the user the header, sidebar and footer. But what it does differently is it shows my layout instead of posts. Using this you can create a portal-looking home page, similar to that of Devlounge and one other site that I don’t remember off hand.

I’ve discovered the home.php is incredibly useful. While hand-coding may be slightly difficult, the results are almost always pleasing. One of the static home page plugins I’ve used before didn’t make the cut, and not using it was not worth it (sorry Semiologic).

One little secret: I got the inspiration for the edit in the shower last night. Amazing what relaxation techniques can bring (either that or I’m just a good brainstormer).

I’d like to publicly thank Turbocharged for acknowledging my accomplishment on his blog. But I’d also like to thank him, since it was his code that gave me the inspiration.

As I once said: I’m not a coder, but I know how to make ends meet. That includes hacking (not cracking) other people’s code.

See also:

130 Comments

That’s really great – I’m so pleased I found your blog! All the homepage solutions seemed a bit kludgy – the Rudd-O one was best, but I was struggling to see how I could do anything really interesting with it (i.e. build non WP content into the site). This is just the sort of thing that I was looking for.

[...] Go there and check it out for yourself. Check the top navigation bar. A nice home page, clean navigation URLs and a blog, to boot. Couldn’t get any better than that. Go learn and see how it’s done. [...]

Thanks to you for mentioning your inspiration.

On another note: some lines are wrapping oddly. What tripped me was the part that says // begin the loop.

I myself have been using a heavily customized index.php for my new blog template (running at Rudd-O.com) to make WP into a magazine. I’m thinking about releasing it but right now there are a few “IE issues” I need to take care of first.

@Rudd-O: I looked at your site a few times. I like the concept of your design, but in reality I feel confused while browsing. Popular and Recent lists have seemingly randomly located items. But overall, it looks nice.

Anyone who finds my code useful is very much welcome to use for whater you want. If you really like it, please leave a comment or a trackback saying so.

@Rudd-O: your method is very nice. I just want to confirm some points with you before I start adding my static page.

My current WP 2.1 blog installed at http://www.icouple.sg/blog

Let’s say I would like to put the static page “Home.php” at my root: http://www.icouple.sg

Is that possible to do so with your method. Thanks for helping me out, I’m a newbie with PHP stuff.

Looking forward to your reply :)
Regards.

I think I made a mistake in my previous comment, my question is meant for Micheal (not Rudd-O) – don’t know what happened to me :P . Thanks and regards :)

I posted my question again, hopefully Micheal can clear it for me:

My WP is installed in http://mydomain.com/blog/

I would like to place a static front page at http://mydomain.com

Is your method supposed to work in that situation. Please help me out on this. I’m a newbie with PHP stuff.

Many thanks and regards,
Quang Minh

@Quang Minh: I am not sure what “question” you are referring to. I may have deleted your comment after mistaking it for spam. Could you please explain what you are asking?

@Quang Minh: Sorry about that confusion. What I have done to implement my static front page is as follows:

  1. Create my home.php file, and place it in my theme’s directory.
  2. Change the text of the original Blog link to read Home, and changed the HREF of it to point to my site’s root directory.
  3. Add a link after that titled Blog which points to nyceducated.info/blog/page/1. This is part of Rudd-O’s original trickery to the whole method. I also messed with some code to make only the Blog link appear highlighted in certain circumstances, and Home in others (if you want, ask me and I’ll elaborate about that).

It does take a bit of effort to make everything work, but it’s not that difficult. If you need help, just say so and we’ll ocntinue this via email (or AIM if you have it).

Note: for some strange reason, my theme is doing strange things wit ordered lists. Treat every section with a line between it as a numbered bullet.

Thanks for the details, Michael. I get the main ideas :) I’m trying it out now.

Best regards,
Quang Minh

Great instruction. Now let’s see if a noncoder can figure this out.

Parse error: parse error, unexpected T_STRING in D:\xampp\htdocs\wordpress\wp-content\themes\LGBlue\home.php on line 27
This is the line .
Any idea what am I doing wrong.

If you made an exact copy of the code in this post, you probably won’t get the desired result. Also, I have a feeling that you may have tinkered with some of the code, which is probably the cause of the error.
If you would like a copy of my current home.php file, leave another message, and I’ll email it on to you.

I get a exact copy of the code to, and a get almost the same error: Parse error: syntax error, unexpected T_STRING in xxxxxxx on line 26.

Can you please email me a copy of the home.php?

Thanks, Rob

@Rob: Sure thing. I will send you an exact copy of my home.php file. You will need to edit it heavily, since most of the stuff in it (aside from the Loop, but even many things inside the Loop) is specific to my site.

Hi Michael
I love what you’ve done here. I am very new to all this, so in danger of losing my grip on the learning curve:-) I have just switched themes to Fall Season but am trying to make one or two alterations, including setting up a nice static home page like yours. Is it possible that you could send me the php file for your home page? Looking forward to having a play with it all!
bfn
Dave

Hi Michael
I live what you have done with your home page and would like to do something similar with my own at http://www.monnowlogue.com but… I’m on a steep lurning curve and in danger of losing my grip. ANy chance you could send me the home.php file and then I can try and ahve a sensible play with it?
bfn
Dave

I’ll will be glad to send you a copy of my version. Beside the creation of home.php, you will need to add some code to header.php, which will give you the blog link like I have above. There is a bit involved in this, but once it’s all done it works like a charm.

Michael: I would also like the code you offer for my site, thanks.

Sure thing. Great to be spreading the joy so to say.

Instead of just emailing the file, what about offering it in a downloadable text file? That would clear up any problems displaying the code in your page, and would allow you to clean up your instructions in this post’s example.

I’d love to compare it to what is described in the WordPress Codex so we can update the content there to help others struggling to do the same thing. Your help would be appreciated.

Thanks and great work!

If you would like a copy of my current home.php file, leave another message, and I’ll email it on to you.

Yes PLEASE!! This exactly what I am looking for I think… LOL! And yes I agree with Lorelle’s comment above who by the way has some of the most unbeleivably usefull information and has become my go-to first stop resource when I am trying to find out “how-to” which is how I found this site.

Kudos to both of you!

Kevinj

@Kevin: With regard to our statement about Lorelle’s blog, it is undeniable. I have been subscribed to her blog before she even commented here. I suppose we can use the info she provides asmuch as that of the official WP Codex.

Check your email for the source code.

I have been unable to make this work with my TripleK2 Theme. Read, reread, and tried this several times, checked and rechecked my work. I have written to the theme developer, awaiting a response.

Should clarify, I also tried the settings in WP 2.1 but still does not work.

love the way you set this up and would love a copy of the file to work with – thanks!

Hi Michael, could you please send me the complete code that you used? I have tried Rudd-O’s solution previously and I believe yours would suit me better.

btw, are you running your code on wp 2.1.2? If not, do you know if it’s compatible, or does the wp version even matter?

Thanks very much!

Wow, your website design really blow my mind away, this could save my countless hours for trying to customize the front page for my new blog website!!

Micheal, could you please email me the codes with all the plugin too? or point me to a place to download. Thanks, this sharing is great:)

@Ken and JoLynn: I will send you the files and further instructions ASAP.

@ken: There are no plugins involved, just the home.php file.

@JoLynn: I am currently using WP 2.0.7, and I will be upgrading to 2.0.9 when I get around to it. I have not tested the code with anything other than 2.0.7.

Originally from http://forums.wpthemes.info/comments.php?DiscussionID=282&page=1#Item_0“:

Sadish,
First Kudos on all your work. When I stumbled upon Fall Season and your “the-real-ultimate-static-front-page” using this theme I knew I had found something I could use for a new site I am building.

Would it be possible to ask your help in constructing the static front page (home .php) similar to his example? I received your home.php but it doesn’t use the “Asides” and I am a little confused as how to do this.

What I am looking for is to have this idea on the front page of Fall Season;

———————————————-
Header Search
———————————————-
Header Image
———————————————-
NAV
———————————————-
Intro
———————————————-
[Asides] | Sidebar |
——————————- | |
Intro2 | Latest | |
| (links only) | |
——————————- | |
category Links [title] | |
[cat name] | [cat name] | |
-links | -links | |
———————————————–
Footer
———————————————–

Thank you for your time.

currently the asides code in the index.php looks like this;


\s*|’, ”, $str);
}
ob_start(‘stupid_hack’);
foreach($posts as $post)
{
start_wp();
?>

“>
post_content); ?>

“>

Best Regards,
kevin

I’m not too good at drawing with the pre tag :)

@Kevin,

I emailed you with more complete instrctions for working with home.php. I also explained why it isn’t really posible to seperate the Aside posts from the regular posts. If you need any more assistance, feel free to ask.

Michael.

Thanks Michael, I’ll look for it and let you know how it goes once I can play with it. Thanks again!

Thanks Michael, I’ll look for it and let you know how it goes.

If you don’t mind, please send the complete instructions you sent to Kevin when you send me the code. Thanks again!

Michael – I’m getting started with a website and I’m trying to use wordpress as my CMS while maintaining a blog portion. I would be really interested in using your method to provide a more “website” feel rather than “blog” feel throughout. Would you mind sending along your method?

Hey Michael

Boy, am I glad that I stumbled on your site. Great job!

Would you please send me the complete code for the ultimate static front page?

Many thanks and all the best.

Paul.

Hi Michael,

after trying some PHP CMS solutions, I droped back to wordpress. Now I saw you nice instruction how to setup a static frontpage and your offer to share your code. Would be so kind to send me a copy over?

Thanks and with kind regards, Jan.

Can I get the source for this? It looks like just what I want.

I am looking for alternatives to salvage the static look while incorporating it into WordPress dynamic features. Your code example may be the right start. Thanks !

Hello Michael,

Great site and info & the perfect solution for what I need. Would you please send me the complete code for the ultimate static front page.

Respectively,
Jeff~

please could provide me the code?

Hey, I love that homepage layout! Can I please have the code to set it up? thanks so much.

Hey Michael,
Your website is amazing! I’m glad someone took this idea and expanded it into something actually usable. I mean, there are so many other ways to make a static front page but this is so much easier to configure. can you send me a copy of your source? thank you and reply soon!
-Tony

For those that I emailed already, check your inboxes. If I didn’t get to your comment yet, I will try to respond as soon as possible.

Hello, Michael.

Yours looks like the perfect solution for me.
Please send me a copy of your static front page source.

Thanks!
Terry

would love to test this!
would you send me this brilliant solution please?
thanks!

Been looking for ways to create a homepage feel to help with my tracking. I’m looking forward to seeing if your code can help.

Many thanks

Hi Michael, would you be able to send me the code? Looking forward to it, Max

I’ve been wanting to do this for some time. Possible I can get the code? Thanks!

I’d be interested in getting the full code, as I am investigating building something like you have here – a blogging platform inside an interactive, informational portal. Many thanks!

Hi there,

This looks like a great solution, would you be able to send me the code? I’m a newbie and looking forward to the headaches.

Hi Michael,
Trying to setup a wordpress driven site down here in Ecuador (working as a volunteer)… now they want a different homepage than the out-of-the-box one…
So you can guess where I’m going… Hope to get mail from you soon.
Keep up the good work,
Regards!
Edwin

hi

i would like to take part of your code.
i’m trying to fix a static front page that feeds from three different wordpress db.s, and i would at the same time need to use wordpress code and plugins from at least one of them on the front page, maybe this is what i need.

/Dan

Please send me your code for a static front page plus blog. I get it partly working then something else breaks.
Thanks so much.

Hello Michael,

I’ve been looking for this kind of thing for a while. May you please send me the source code for the static front page?

Thanks

Hi Michael,
I’ve been struggling with the whole static home page thing and your solution seems just perfect for a site I’m working on. Could you please send me the source code for your static front page?
Thanks!
Karen

Hi Michael
I have been messing with a few solutions for a static page. Yours looks like it could do the trick. Could you please send me the source code and instructions.
Thanks.
Paul

Hello Micheal,

I’ve been reading through a lot of stuff about static pages with WordPress and I’d like to give your way a try please. I’m fairly new to WP and have just starting teaching myself php.

Please could you send me your code and instructions so I can have a go hopefully sort out my site.

Thanks in anticipation

Angela

Hi Michael,
I am a WordPress newbie and am wanting to create a different home page to that provided by the theme (Day Dream). I am hoping that your code and instructions will help me.
Thanks,
David

Hi Michael,

I really want to have a separate static home page from the blog that I’m going to create. I’d really love to get the code for your solution to this.

Thanks so much in advance and for sharing.

TMG

Could you please send me the code too.

thanks.

Hi Michael
This looks like a good solution to a common WordPress problem, I’d reslly appreciate the source code so that I can test drive it on my site. Thanks for your community spirit!
Andrew

Everyone preceeding this comment should have recieved code and instructions.

I am trying to put together a guide for setting the whole thing-a-ma-bob up, but I just don’t have the time. However, anybody who comments or other wise contacts me will still get a response.

Fantastic work!

I’ve just started blogging and learning php, so anytime I can get my hands on information like this I’m really excited. If you could drop me the full source, I’d love to adapt it to my site.

Thanks again to both you and your inspiration (Rudd-O).

If I can muddle through the code this weekend, I’ll try and write a Set Up document for you if you’d like. I think this’ll be my first trackback as well

;)

was lying bed last night trying to work out how to set up my blog with a static home page. Seems I don’t have to look too far.

Michael – yes please send me the code so I can get this thing up and running.

love your work! :)

Hi Michael,
I’d be really grateful if you could send me on a copy of this as well – like others here I’ve been looking for a solution and this seems to be exactly what everyone’s after.
Many thanks in advance and brilliant work, it’s much appreciated.
Garry

Hi.
I’m just converting one of my websites to a blog site and it would be so great to have a homepage like you describe. If you could send me the full code, I would be much appreciative.
Brian

This site rocks!

It’s exactly what I’m looking for… using WordPress as a CMS.

Would love to learn how you created this custom made layout with the slimmed-down WP Loop.

gosh, I’ve spent hours scouring the net trying to figure this out! I thought I found it with adhesive. Yes,
this is the motherlode for me. Thank you for your creativity and hope to receove your code and how to.

[...] Based on the fantastic code put together by Rudd-O over at the TurbochargedCMS site and Michael over at NYCEducated.info, I was able to create exactly what I was looking for.  The new home page for TheTechFairy.com is laid out using a version of Michael’s code (which was based on Rudd-O’s code).  The biggest change is the complete reliance on CSS for the layout.  Rather than use tables, the code has been altered to use the <div> and <span> tags, along with id and class selectors, to create a table-like layout. [...]

Great post, I’m new to WP and blogging in general and this is exactly what I was thinking of doing. I’d appreciate an email with the code. I am a coder, but not PHP, I have enough to be dangerous, and that isn’t always a good thing. Thanks in advance.

Michael
Yours is the answer to my endless search for the static front page. Pls. email me the source code. I would love to work on it on my own – but since you already have it – it will save me weeks of research. Thanks!!!

Most of the people have already said what’s on my mind… Finally a real solution to the static page problem.

I would really appreciate If you could send me the source code… I am planning on developing a page with WordPress as CMS (like so many others at the moment ;) )

Thank you!!

Pomi

This is exactly what I’m looking for… please for the code! thanks!

This could be exactly what i have been looking for. Please can you email the source code, highighting all changes taht are required, thanks in advance ;)

I’ve been looking for a way to make a CMS tool out of wordpress. Youurs looks like a clean solution. Can you send the source? Thanks

[...] Another Static Homepage technique from Educated [...]

Hello Michael,

Your site looks great! Could you please send me the source by email? I am very interested in the static front page and would like to include this in the bmx cross site for my kids.

Thanks,

Jan-Willem Mulder from The Netherlands

Ive been looking for a solution like this. Mind sending the code over.

Hi Michael! I’d love to borrow your code for a static home page. Thanks for sharing — I really appreciate it.

Anyone who has commented until this point should have recieved the code via email.

Due to the overwhelming demand for code help, I will no longer be offering the service by default. Some exceptions might be made, but they will be done privately. The code will be available to download from the site soon, and after that, the comments on this post should not be used for requesting edits.

Thank you in advance for your cooperation.

Hi, Michael!

Thank you for your contribution.

I would like a copy of your home.php

Hi – i’ve got a website in development. I want to use the theme found here – which is 3 column widget ready: http://themes.wordpress.net/columns/3-columns/791/wucoco-three-column-0100/

But I want a static home page and a few others (yet looking like the theme). In addition, I’d like one of the pages/links to be the actual blog – just not the home page… I need standard type pages – home, about….etc.. plus blog.

I think your solution is the one for me. Please email the code to me – it will be very much appreciated.

Hey Michael this looks great, can i have a copy of the code please. Thanks.

Just last night I made myself a seperate homepage following the code here:

http://turbochargedcms.com/2006/11/building-a-true-home-page-into-your-wordpress-blog/

Unfortunately, as you know, its rather limited and I would like to have my sidebar still. Would this enable me to keep my sidebar and most importantly my recent blog posts in the sidebar?

You said to ask for the full code, so here I am. HEELLLPPP!!!! :)

Hi, I really like this concept but am a bit deficient in PHP. I would like the whole code. It sounds like a perfect solution to a problem I have. I would appreciate it greatly!

Just last night I made myself a seperate homepage following the code here:

http://turbochargedcms.com/2006/11/building-a-true-home-page-into-your-wordpress-blog/

Unfortunately, as you know, its rather limited and I would like to have my sidebar still. Would this enable me to keep my sidebar and most importantly my recent blog posts in the sidebar?

You said to ask for the full code, so here I am. HEELLLPPP!!!!

Sorry, but I don’t know what seperate home page you are referring to. In general, you should be able to use all and any current functionality with the home.php solution, either mine or Rudd-O’s original. Make sure you keep the call to get_sidebar() or however your theme gets the sidebar in the regular index.php template.

On the side: “Full Code” means everything that powers the home (“/”) or blog (“/page/1″) check and builds my custom layout.

Hi,

If you have a look at my site here http://rest.2bscene.net/home/ you will see I am have a photo gallery and a specials page. I am trying to build a website for a restaurant and I need both the recent specials and perhaps the 6 most recent photos appearing on the homepage.

Is you code the solution to this?

Hey, great work on creating something so useful.

Since I’ll be using WordPress to publish my articles, I’ll use this to create a Table Of Contents so visitors can find the article they want without having to resort to search.

Keep on hackin’

@Darren: If you can find some way to show recent photos from the gallery on the home page, this could be perfect for you. With some modifications to the theme itself, you can create the perfect setup.

(See my previous note about theme editing for this solution.)

Hi, I got your code. There is an include for a file called intro.php which I don’t have in my theme so I just omitted it without a negative effect.

But I have just realised. You layout that displays for the homepage is not updateable through wordpress. The main content area is just hardcoded html. How is the user supposed to change the content of the page?

Michael, I’ve been looking for a front page solution for WordPress. and this one seems very interesting. Would you please send med the necessary code snippets to copy your solution? Thank you in advance.

Hi Michael, I too have been scouring the web for such a solution. I would appreciate receiving the full source code for a static home page if possible. Thank you.

Everyone before this comment should have the code. As I pomised, the post with limited instructions and a straight download of the code is coming soon.

Hi, I got your code. There is an include for a file called intro.php which I don’t have in my theme so I just omitted it without a negative effect.

But I have just realised. You layout that displays for the homepage is not updateable through wordpress. The main content area is just hardcoded html. How is the user supposed to change the content of the page?

Darren

The intro.php file is specific to the Fallseason theme I am using.

I understand what you are saying. The main purpose is to have a home page that can be seperated from the rest of the site and still maintain a common look, as I have done. You can, however, include multiple calls to the WordPress Loop, displaying posts from different categories, or even use plugins to display misc. content (like how I have recent Flickr pics displayed). It’s static since the main HTML content is not loaded from the database, and dynamic because it’s all pure HTML and PHP.

Hi, I am redoing my website with wordpress, when checking on method on how to use static pages, I come across your post. I would like to have your code please.

Once, the site is redone, I will post it here as well.

Thanks

This is great work – saved me hours. Please send me the code. Thanks for your community spirit.

I’d love to have a copy of your code. Thank you!

Hi.This looks like it could really help out a newbie.Please send me the code.

Thank for sharing you code with us, may I have a copy please:)

Lane R. Ellis

June 4th, 2007
at 1:13pm

Dear Michael,

Thank you for the work you’ve done in modifying WordPress with your “Ultimate Static Front Page” code. I have looked through the code you’ve posted, and would like to see the full version. Thanks again for your time and effort, and keep up the good work!

Best Regards,
Lane R. Ellis

Looks great, can’t wait to start building my own static frontpage :-)

Michael, If you could email me the code, it would be very much appreciated!
thanks

Hi Michael, I’d appreciate the code to static frontpage, though I’m concerned that implementing it might be a bit beyond me! Thanks…

Hi Michael, I’m a rank newbie to WordPress and PHP, so I’m not sure if I can implement your code successfully – but I’d certainly like to try. Thanks!

Hi Michael, great work!! I was looking for this for a while… great info! Can you please email me to direct me further how do I use it on my site? Thanks!!

Hi,
Michael.. that’s a great works..
Please help me with your code..
Thank you so much..
=)

Please send me the code you use for your front page. Looks great

Thanks

Hey Michael — working on a new nonblog project and taking the opportunity to learn WP, which I’d like to use as the backend for small ‘News’ content updates to static pages. Would love to have a look at your code. Thanks in advance!

Michael,

Could you send me the code? I think this is the solution I’m looking for to have a blog running the actual content/posts but have a main page that has other content, including a news list just like you have on your page.

Thanks!

Justin

Is this really simple to execute? If so, please send me the code. I’d greatly appreciate it as I believe what I’d like to do is exactly what you’ve explained above. Thank you so much.

Hi! Would like to use your code. Please send it over! Thanks for the help.

This is *exactly* what I’ve been looking for! It’s one of the reasons I’ve hesitated on switching our website to WordPress. I’m not there yet, but if I could have a copy of your code, it would help greatly. Thanks!

Hi,
This sounds like exactly what I need! Could you please send it to me?

Loved your home page. Would love to do a dynamic front page like that. Nervous about the coding, but willing to try it since I see it worked for you. Looking forward to the info.

I would like to get a copy of the source code please, and many thanks.

Hi Michael,

I’ve been trying to get the redirect to work and I run into a problem other commenters seem to have as well, but one that wasn’t addressed here…

The redirect works to my blog page when i follow the link /blog/page/1 but when I click previous posts link to /blog/page/2 i see the same front index.php page. it might be something with my permalinks; I can get to my second page of posts by typing in /page/2 but I wan’t the links to be generated by the wp_next_posts_link() function. I’m on WP 2.3.

I appreciate your help!

@eyecue:The reason you see the /blog/page/1 change between the home page on my site and the blog index is because I have a second copy of the WordPress root files in the root directory of my site, with the originals in a subdirectory named “/blog”. I kept the same permalink structure that I had before copying the WP root files down to my public-html folder.

Still having some trouble. I see what you’re saying though with the /blog/page/1/. The problem I keep having is that the link to mysite.com/page/1/ doesn’t redirect me to my first page of blog posts but to my static page again. Oddly enough mysite.com/?page=1 gives me the first page of blog posts but so does mysite.com/?page=2. I’m guessing it’s because /?page=1 or /?page=2 gives it a parameter to start the redirect but /page/1/ does not.

Any ideas?

Thanks Michael.

@eyecue: Honestly, I don’t have any ideas. I don’t fully (or even close to fully) understand the inner workings of the WP Loop. Unfortunately, my trick isn’t a one-size-fits-all solution; rather it’s just a creative use of WP’s built in parameters. I apologize for not being able to help.

Michael,

While this all sounds good and many have had great success, what throws up a red flag for me is that the WP codex says that “home.php” should not be used as a home page template. (Reference: http://codex.wordpress.org/Creating_a_Static_Front_Page )

I’m starting a site for a client that will need a static front page and I’m using the Default Theme as the base. And there’s no “home.php” file in the theme. So do I create one anyway? I’m on WP 2.3.1 and what I’m also wondering is if many others are doing this with 2.1 and later? This seems to contradict the Codex warning, and I’d rather be safe up front than sorry with a ton of coding done and a major problem.

Thanks!

Is it possible to get the code? Did you post it somewhere? Thanks.

thanks for the GREAT post! Very useful…

@Whatever-ishere:You are welcome. Feel free to comment with any questions.

Hi,
Since I updated to 2.3.1 my site doesn’t work properly anymore.
The Blog link (page/1) is the same as Home, and the Home page doesn’t show my latest post.
What has been changed and how to fix it?
Thanks

I resolved the not showing latest post in home by updating some plugins, but the page/1 remain a problem

[...] Educated Network » WordPress Secrets: The Real Ultimate Static Front Page [...]

Ah, now this is a great idea. I love the idea of static home pages. This might just be the ticket I’ve been looking for. Now, if we could somehow integrate a static home page that somehow knows more or less what would interest the viewer the most; now THAT would be quite a breakthrough! A heck of a lot of work for designers, but it would certainly be another new stage on the internet, that’s for sure!

thanks, looking for this article, its very useful. but did you know how to make portal for wordpress (like portal for smf)

Thanks for this code! I just implemented it before I even get to the other parts of the design for my own theme.

I’m a bit rusty though – if I click on Blog it brings me to a page with a single post plus comment. I’d rather have it so it shows me the actual blog with a post and excerpts of others plus the usual.

The question is: How?

[...] WordPress Secrets: The Real Ultimate Static Front Page » Educated Network (tags: webdesign tutorial howto php article wordpress cms blogging) [...]