Skip to main content
Nancy OShea
Community Expert
Community Expert
March 9, 2023
Question

WordPress: Classic PHP Themes vs Block Themes

  • March 9, 2023
  • 1 reply
  • 471 views

WordPress Theme developers are probably already familiar with Classic PHP Themes. But there's a new kid on the block, Block Themes (sorry, no pun intended 😏).

 

Benefits of Block Themes

Block themes improve scalability and performance.

  • Block themes enhance loading performance by loading styles only for rendered blocks on a page.
  • Block themes are not required to manually enqueue stylesheets for both front-end and editors.
  • Theme.json handles all aspects of add_theme_support().
  • Accessibility features such as Skip to content, keyboard navigation, and landmarks are generated automatically without adding additional code.
  • With a block theme, the user can edit ALL parts of their website without code.
  • By using the Styles interface, users can customize colors and typography for the website and for the blocks

 

In a standard HTML file, you would include an HTML tag, <head> and <body>.
In block themes, these HTML elements are added for you. Necessary PHP hooks that you would add to a classic theme, including wp_head(), wp_body_open(), and wp_footer(), are also added automatically. The markup that is inside the template file is printed between the opening and closing body tags.

 

Differences & Similarities between Classic PHP Themes & Block Themes (see chart below).

https://developer.wordpress.org/themes/block-themes/#differences-and-similarities-between-classic-themes-and-block-themes

 

What is a Theme JSON?

Theme.json is a configuration file for theme styles and block settings.  Theme.json can be added to ANY theme.  It works with both classic PHP-based themes as well as block themes. However Theme.json does not work with the classic editor.

https://developer.wordpress.org/themes/advanced-topics/theme-json/

 

Creating New Themes with Full Site Editing (FSE only works with Block Themes)

https://developer.wordpress.org/themes/block-themes/creating-new-themes-using-the-site-editor/

 

Block Themes may not be everyone's cup of tea so WordPress will continue supporting Classic PHP Themes.  But if you're looking for full site editing, faster performance or a streamlined site without baked-in widgets,  Block Themes could be your golden ticket.

Astra  - https://wpastra.com/

Neve - https://themeisle.com/themes/neve/

Ultra - https://themify.me/themes/ultra/

 

This topic has been closed for replies.

1 reply

Bikin Web
Participant
March 10, 2023

yes .. WP is .json