In block themes, there are two ways to set a homepage: one is by creating a template specifically for it, and the other is by creating a static page and setting it up as Homepage under the Reading options. The table below summarizes these methods.
Create | Set in | Template Used | Display Priority (lower highest) |
---|---|---|---|
Home template | Site Editor | – | 2 |
Static page | Settings > Reading > Static page as a Homepage | No Title or its equivalent. Or add Custom CSS to hide the page title. | 1 |
Front Page template | Site Editor | – | 0 |
You may be familiar with the classic method of setting up a homepage by creating a page and then setting it up as a static homepage in Reading options. This method still works on a block theme. However, block themes offer template creation specifically made for that purpose, namely Home template & Front Page template.
Some block themes already provide a Home template, but others only include the Index template, which is a fallback template for all pages when a more specific template is not defined. Examples of these are Twenty Twenty-Three and Wei theme, respectively. However, you will also find that some other themes include a Front Page template, such as the Beaumont theme that I used for my site. Therefore, you need to study your preferred theme before creating a homepage.
However, the method we choose depends on our needs, but first we need to understand the display priority order between those methods. The Home template sits at the lowest priority among the other two methods. So, if you want to override the Home template provided by a theme, you can do so by creating a Page or a Front Page template. A page is independent of a theme, while templates are fully dependent on a theme. This means that templates are not transferable between themes; each theme brings its own set of templates, while a page is transferable, although you may have to make major/minor adjustments if you change themes.
If you then decide to make a Front Page template, you should know that this template will take precedence over any Home template or static Page setup you have on your website. This is because a Front Page template has the highest display priority order. So again, check your preferred theme before creating a homepage for your website.
I hope this explanation clarifies some of the confusion surrounding front page on a block theme. Any questions on whether you should choose a page or templates for setting up a front page will be covered in the next blog post.
Updated (June 13, 2023)
I just discovered that we can combine a static page and a front page template to work as a homepage. To do this, first, create a static page and set it up as a homepage under Reading options. Next, create a Front Page template in the Site Editor, and then add a Post Content block on the template to display the content of the static page.
Leave a Reply