If I create a home.php file, it seems that WP will use that instead of index.php, so index.php is never used?

What are the differences between these two template files (located in the theme folder)?
Do they both behave the same way, the only difference being the priority of home.php?

3

  • index.php is universal template, it is what any page (home, archive, single post, etc) will use if no other template is available for it.

  • home.php is a template used for main page (on is_home()) condition.

See Template Hierarchy for detailed scheme of how templates are applied.

Leave a Reply

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