Features of WordPress 6.2
WordPress 6.2 Expands Block Patterns Directory, Adds Openverse Image Search and Insert。
The emulsion theme’s response to this change
enhancements to the emulsion theme
The variation displayed in the editor/style list has been added to the conventional 3 + 6 variations.
Newly added variation
- twiggy is a variation with Japanese usage in mind
- Centered (front end only)
- In general, style variations are centered around customizing fonts and colors, but are experimental variations that challenge centering the title.
- Grid(front end only)
- It is standard to set the grid display by editing the template of the editor, but it requires several steps and may be difficult for first-time users.
- This is an experimental variation that challenges grid display with one touch.
- Technically, in the case of grid variations, the method is to use WP_HTML_Tag_Processor() and add a class. Therefore, front end only
Style Book (New in WordPress 6.2)
Color and margin settings are now reflected in real time for each block.
Some functions: For example, there are some items that are not reflected, such as text color settings for each heading level.
You can now write CSS directly in custom block CSS
The theme.json file for the emulsion theme has been rewritten for WordPress 6.2.
Due to this change, versions older than WordPress 6.2 may not display properly in the editor.
The main reason is that the theme.jsono description has become more flexible due to bug fixes.
Added the ability to add sidebars in the editor
Added the sidebar display function in the following templates
You can also add a sidebar widget area on a specific post or page.
On the post editing screen, click the template (single by default) and select “2cos has sidebar widget area” to add a “post sidebar” for posts and a “page sidebar” for fixed pages .
PHP template(Classic Theme) と HTML template(ブロックテーマ)間の互換性の強化
The emulsion theme is a universal theme that allows you to switch between the PHP template used by the Classic theme and the HTML template used by the block theme.
However, PHP templates using template tags and block markup generate different HTML, so you can’t use both at the same time.
Think of static page templates. It is possible to create a static page template in php within a block theme (the PHP template must be created locally and uploaded) and works fine.
If you create a PHP template using the template tag in the block theme, like in the Classic theme, the CSS corresponding to them is not prepared, so it will be displayed as an unsightly page.
If you have a PHP page template that outputs the same HTML as the block theme, it will look the same as other pages, and HTML templates and PHP templates can coexist.
For the emulsion theme, I was looking for a way for PHP and HTML templates to coexist with each other.
The emulsion/fse-compatible-classic-template/ folder contains four PHP templates:
Templates of this kind must be placed in the fse-compatible-classic-template folder.
- When you select this template on a post or page, the post will be displayed with a sidebar
- For posts, the “post sidebar” on the widgets page is displayed
- For static pages, display the “page sidebar” of the widgets page
- If you rename it to archive.php, the archive page will render using the PHP template instead of the archive.html template
- By renaming it to page.php, the static page will display using the PHP template instead of the page.html template
- Renaming it to single.php will make the page display using the PHP template instead of the single.html template
I think the advantage of using PHP templates is that you can include post-related functionality, etc.
How to identify if a PHP template is being used or an HTML template is being used
When displaying an individual post page When an HTML template is used
is-tpl-single_template class in the body element。
When displaying an individual post page When a PHP template is used
is-tpl-single-php class in the body element.
The display using PHP templates such as BBpress plug-ins and the normal theme display can be displayed with the same design without any discomfort.
Style variation Platen Home Page
BBPRESS Forum. with Classic template tag