What is a Block Theme?
“Block themes are sometimes called full site editing themes. A block theme is a new theme that you can use from WordPress version 5.9. It is built mainly using HTML and a theme configuration file. The block theme is composed entirely of blocks, allowing you to edit all parts of your site in the Site Editor” explained the development team.
What is a Classic Theme?
“A classic theme is the original theme, without version limitations, that primarily uses PHP, JavaScript and CSS. Classic themes take advantage of WordPress PHP functions, hooks and filters” explains the WordPress development team.
What are all the differences between block themes and classic themes?
Classic themes and block themes have many similarities, but also differ in some key ways. Classic themes use PHP files to display content and parts of the page, while block themes use HTML files to display blocks.
Classic theme developers can use widget areas (sidebars) and widgets, while block theme developers must rely on blocks instead. In terms of template hierarchy, both types of themes follow the same structure.
For WordPress custom theme developers that are accustomed to creating classic themes, this comparison table below looks at all the important distinctions between the two and provides great insight into what makes the two methods for development different.
Classic themes: | Block themes: |
PHP files to display parts and site content | Uses HTML files to display blocks Uses PHP files as a fallback if WordPress can not find the HTML file single.html is the equivalent of using single.php |
Uses the standard template hierarchy | Uses the WP template hierarchy |
Uses PHP functions such as template tags to display content | Uses blocks for everything The post content block is the equivalent of using the_content() |
Use PHP functions to make text translatable | Text in HTML files is not translatable Block patterns can use PHP functions to make text translatable |
Uses PHP functions for if/else conditionals | Uses block settings to achieve different results |
Uses the loop to display different posts and post types | Uses the query block and the post template block |
Can use widget areas (sidebars) and widgets | Uses blocks instead of widgets Widgets included in WordPress have been converted to blocks |
Can use the Customizer | Uses the Site Editor. Can optionally enable the Customizer menu |
Must register a navigation menu to include a menu | Uses the navigation block |
Can register a custom header | Uses blocks to fully customize site headers including images |
Can register a custom logo | Uses the site logo block |
Can enqueue custom CSS and scripts | Can enqueue custom CSS and scripts but relies more on blocks and the theme.json configuration file |
Can use theme.json, but theme authors need to enqueue the styles for the front. | Can use theme.json, and the styles are enqueued automatically to the editor and front |
Can place template files in the root directory | Places template files in the templates folder |
Can place template parts in any directory | Places template parts in the parts folder |
Can not create and edit site templates like 404 and archive pages in the Site Editor | Can create and edit site templates like 404 and archive pages in the Site Editor |
Can create and edit block templates in the Template Editor with theme support | Can create and edit block templates in the Template Editor |