OK. I’m getting conflicting instructions from my training resources (again).

This time the issue for me is “how to set a default homepage”.

One tutorial (Coyers “WordPress 3: Creating and Editing Custom Themes”) uses home.php, while another (“Professional WordPress”) recommends setting “Front page displays…” via WordPress (Settings > Reading). …aargh!

In checking the forums and blogs, I see the same issue: conflicting advice. With one user advising to NEVER use the home.php template page in a theme as “It can cause problems on some servers”. Is this true? And another user swearing by it.

…What is a noob to do?

So, given the confusion (and given that I’m a noob looking to do things the right way)…

  1. What is the difference between the two approaches?
  2. Which approach to a standard homepage should one use when creating a theme?

thanks,

sleeper

1 Answer
1

  1. Simply put, the WordPress template hierarchy reserves home.php for the homepage, but if you set a Front Page post, it will display that instead. If WordPress core developers reserved it for the homepage, I do not believe it would cause issues with any servers, because they would be putting everyone at risk. Hope that explains it for you. 🙂

  2. It is completely personal preference.

From the WP Codex:

  1. WordPress first determines whether it has a static front page. If a
    static front page has been set, then WordPress loads that page
    according to the page template hierarchy.
  2. If a static front page has not been set, then WordPress looks for a
    template file called home.php and uses it to generate the requested
    page.
  3. If home.php is missing, WordPress looks for a file called index.php
    in the active theme’s directory, and uses that template to generate
    the page.

See the relevant WordPress Codex page for more information:
http://codex.wordpress.org/Template_Hierarchy

Leave a Reply

Your email address will not be published. Required fields are marked *