Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

When to use home.php or front page.php?


Asked by Amoura Gonzalez on Dec 09, 2021 PHP



If the setting “Front page displays” is set to “Your latest posts” and front-page.php does not exist, WordPress will use home.php (if it exists). If the setting “Front page displays” is set to “Static page: Front page”, WordPress will use the selected Page if front-page.php does not exist.
Indeed,
The front-page.php file is the site front page template. It will always be used on your site front page, regardless of whether get_option ( 'show_on_front' ) is set to page or posts. The home.php template file is the blog posts index template.
And, The front page template takes precedence over the blog posts index (home.php) template. If the front-page.php file does not exist, WordPress will either use the home.php or page.php files depending on the setup in Settings → Reading. If neither of those files exist, it will use the index.php file.
Keeping this in consideration,
Regardless of settings, if neither front-page.php nor home.php exist, WordPress will use index.php to display the front page. If the setting “Front page displays” is set to “Your latest posts” and front-page.php does not exist, WordPress will use home.php (if it exists).
Consequently,
I know that traditionally you can have 2 main pages: the static page (front-page.php)and the page for the last posts(home.php). Right now, front-page.php (Home) is my "index" page. It has some con... Stack Overflow About Products For Teams Stack OverflowPublic questions & answers