When does WordPress call the home.php
vs. front-page.php
template? What determines which one is used? What determines if is_home()
or is_front_page()
or both is/are set? These are common points of confusion and frustration. Come play to learn with this interactive guide.
Short Answer: You configure it
You actually configure how you want WordPress to handle what template is the root web page and which one will be called. You do this via the configuration settings specified in the Settings > Reading > Front page displays
screen in the WordPress back-end. Aha!
But here’s the confusing part. Ready? The terms and wording don’t always match up to what you might think. Bummer.
Instructions
Using the form below, select the setting you want. Then click on the “Try it Out” button. This guide will give you the corresponding information for that specific configuration, i.e. scroll down to see the tutorial.
Huh, what does “root” mean?
“Root page” means the main web page that appears when someone types in the root of your website’s domain. For example, https://yourwebsite.com
would be a root web page request.
Go do this hands-on programming lab to explore how this works and see for yourself how the templates and states are called/set within WordPress and your theme.