page-template-hierarchy.html

Template hierarchy

WordPress themes have a fairly comprehensive template hierarchy. The template that’s chosen depends on the request. When looking for a template it starts from the left and works its way to the right.

  • The template hierarchy is pretty much the same as for existing themes.
    Just replace the .php with .html.
  • If it can’t find the most specific template it’ll keep looking.
  • eg category-blocks then it’ll look for category-id, category, archive then index.
  • Users of a theme can override templates by editing the supplied template in the Site Editor and saving the results in the database. There should be no need to edit the .html files using the theme editor.
  • Custom templates can be specified in the theme.json file.

References

Navigation

    Page List

    Page Tree ( shortcode )

    WordPress version: 5.7.2

    Gutenberg version: 10.8.0

    © Copyright Herb Miller, Bobbing Wide 2021