In WordPress, you have a few options when it comes to displaying your homepage. You can either display a static one or you can display a dynamic one, such as a page that displays your latest posts. To make the settings according to which one you would like to see, you can either use “Settings > Reading” from the stock WordPress admin area or you can use the “Appearance > Customize” menu, if available to you.
Here is a screen shot of the WordPress admin settings page:
And this is what the “Customize” settings page looks like:
Which Page to Use
When using the static home page setting, you’ll be using the front-page.php file in “wp-content > themes > your-theme >.” Under this setting, your blog listings page will use the home.php file in same directory.
If you decide that you would like to have your homepage to show your latest blog posts, then the home.php file I mentioned above will be used for that and the front-page.php file will be ignored.
Which Files to Create
When creating a theme, you need to remember the cascading nature of how WordPress theme files operate. If you are in the midst of putting together your file structure and neglect to construct a front-page.php file and you decide that you would like to set your homepage to use a static page, WordPress will fall back to the page.php file. Whether this is ideal, is up to you, but if you want specialized functionality for your homepage, using the front-page.php file would be better suited.
The same is true if you would like to display your latest blog posts as your homepage and neglect to create a home.php file. In this case, under this setting, WordPress will cascade down to utilize the index.php file for your homepage. Again, if this is not ideal, it would be advisable to create a home.php file.
You can learn all about static front page options in the WordPress Codex.
Leave a Reply