WordPress.org

Ready to get started?Download WordPress

Forums

Home Page: using index.php instead of home.php (12 posts)

  1. databell96
    Member
    Posted 4 years ago #

    I'm currently in the process of creating my clients homepage. I'm basing it on the Kubrick theme and tweaking it a bit to suit my clients' needs. Got the header and footer looking really good but now I want to include a home.php file I created and uploaded it but instead it displays index.php content. Isn't home.php the first file WP looks for and then index.php? That's normally the case. But this time around I'm on Network Solutions for hosting so maybe things work differently there?

  2. henkholland
    Member
    Posted 4 years ago #

    What problem are you trying to solve by making a home.php?

    Yes, home.php should be the first one but it is outdated and will not work in future versions.

  3. Mark / t31os
    Moderator
    Posted 4 years ago #

    Yes, home.php should be the first one but it is outdated and will not work in future versions.

    I never knew anything about that, can you elaborate on what's being changed, is something intended to replace home.php or is support just being pulled?

  4. henkholland
    Member
    Posted 4 years ago #

    Sorry, sorry, I am sure I read that today but can't find it back (after searching for an hour).

  5. Mark / t31os
    Moderator
    Posted 4 years ago #

    It's no problem, i'll take your word for it if you're sure... WP on the brain? perhaps something in a dream? ... i know i confuse things like that sometimes... lol.. (not saying you imagined it, but i've done it before, so i'm sure it's not beyond anyone else) .. ;)

  6. databell96
    Member
    Posted 4 years ago #

    I didn't know that either. So it would be better to actually make it index.php instead?

  7. henkholland
    Member
    Posted 4 years ago #

    Hi databell96
    I took my statement back but if you are making a special template avoid naming it home.php since home.php has a special role inside WP. Call it anything you like.
    Then again: what problem are you trying to solve with it?

  8. matphoto
    Member
    Posted 4 years ago #

    I'm creating a template as well and am in a similar situation. I want the homepage to have static content and recent post summaries, and right now I have it as index.php. After reading through some of the docs I dont know whether this should be the case or if I should rename it and use the admin panel to declare it as the new home page. I've seen themes that do this with index.php as the homepage though.

    Home.php seems like the obvious filename solution however, but I haven't been able to find out what exactly home.php is used for. If it exists does wp call it automatically, thus bypassing using the admin panel to set a custom-named home page?

  9. henkholland
    Member
    Posted 4 years ago #

    @ mat:
    Use the admin panel to declare a page (not a post) as the static frontpage and also declare another page as the page for your posts to appear.
    About templates and which is used when:
    http://codex.wordpress.org/Template_Hierarchy

  10. matphoto
    Member
    Posted 4 years ago #

    Ok, but just for clarification, according to that, simply making a home.php would be another way to go about it since the home.php template isn't used for anything other than the homepage.

  11. biralucena
    Member
    Posted 4 years ago #

    I don't know why but sometimes the home.php doesn't work form me (possibly something related to the qtranslate plugin?). Now, instead of home.php I use the front-page.php and voilĂ , no problems.

  12. chillstarr
    Member
    Posted 3 years ago #

    I wish someone would update the Template Hierarchy page image.
    I've been referring to that for years and only today discovered that home.php no longer works.
    As biralucena kindly mentions above, front-page.php seems to have taken home.php's place.

Topic Closed

This topic has been closed to new replies.

About this Topic