[resolved] Template Hierarchy (5 posts)

  1. jasonsweb
    Posted 2 years ago #


    I'm a little bit confused about the template page hierarchy of WordPress.
    I'm building a very simple site with just 2 different types of pages:
    - Homepage
    - A default page template with some content and a sidebar

    So I'm just using a homepage template and a template for all the other pages. No blog.
    But what should be the structure of my theme?
    - homepage - index.php / front-page.php / home.php?
    - other pages - page.php?

    Sorry for the very simple question, but I'm very confused and want to do it right.

  2. WPyogi
    Forum Moderator
    Posted 2 years ago #

  3. jasonsweb
    Posted 2 years ago #

    Thanks for your reply.

    I've already checked the links, but am not sure which file to use.
    According to the template hierarchy I should use "front-page.php", because it's a static page. Is that correct?

    But that would mean that I won't have a index.php.

  4. the theme needs to have an index.php (this might get used in all the cases you haven't created a more specific template for), but you could leave it empty.

    so if you have a static front page, you could use front-page.php, and use page.php for all other static pages.

  5. jasonsweb
    Posted 2 years ago #

    Thanks for the clarification alchymyth!

Topic Closed

This topic has been closed to new replies.

About this Topic