Page.php and index.php confusing me!

by Méhdi ZaRhoun   Last Updated April 01, 2017 19:08 PM

I was watching a wordpress course, the explainer has page.php and index.php wich means the page.php must be load, but the home page is loaded with index.php! I used his same files but I has page.php loaded in the home page? How he does override it but I no?



Answers 1


You should read about WordPress template hierarchy.

This question also has some related answers.

In your case, the most likely scenario is: the explainer had set the blog listing page as the home page (this is default option) and you have set a static front page as home page. Since his is blog archive, it's being loaded by index.php and yours is a page, so that's being loaded by page.php.

This is just a typical scenario, but there may be other settings that are affecting which template file to load.

Scott
Scott
April 01, 2017 18:31 PM

Related Questions



My custom template page not loading content inside it?

Updated November 15, 2017 10:08 AM


Single page theme with page templates

Updated October 06, 2017 08:08 AM