Universal Themes, Hybrid Themes and WooCommerce

- written by

In a recent podcast we asked Daisy Olsen how WooCommerce could play an important role when it comes to universal and hybrid themes.

What Are Universal and Hybrid Themes

A universal theme is going to be a theme like we’re used to now, that has a lot of the PHP templates, is using some portion of the existing theming system. And then they can start to integrate in block theme components so that you get a little bit of both. As a result, some of your theme is being controlled by the PHP templates, some of your theme might be controlled by block templates or block template parts, and they can mix and match to some extent. And in its first iteration, a hybrid theme, a universal theme is the final naming that they’ve decided to go with, would just include what’s called a theme.json file. And what that will allow you to do is just set presets and styles and configurations and add and remove support for certain things in the block editor from a single file.

So presently, a lot of these are possible, you do them in function step PHP, sometimes in queuing, JavaScript, and sometimes with helper functions in PHP. But it’s like you have to know all of the things that you need to do for that specific thing. And theme.json, it really simplifies the process. So once you’ve learned how to use it, it’s all very much the same. And that’s the first piece of these universal themes that we’re going to get access to in the next version of WordPress.

Why This Is Important to WooCommerce

From a WooCommerce standpoint, any blocks that are specific to Woo can be set up to have presets, like every time I use this block, I want it to start off, for example, with these style settings. Then you’d be able to do that in your theme.json file. And then it would be ready to go every time you use it, instead of it being just the defaults. Then you have to apply your settings every time you want to use that block. It could speed up the setup process time for someone that’s often using these blocks on their WooCommerce site.

Here is a post on universal theme customizations if you are interested.

You can listen to the full podcast from Daisy Olsen, Developer Advocate at Automattic.

Only the posts on the builder blog here may include affiliate links. If you click on them and make a purchase, I'll get a commission, at no cost to you.