WordPress 6.2 and Emulsion Theme

Starting with emulsion theme 2.6.7, WordPress 6.2 is required.

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

Block Pattern

openverse

enhancements to the emulsion theme

STYLE VARIATION

What is STYLE VARIATION

The variation displayed in the editor/style list has been added to the conventional 3 + 6 variations.

  • Default
  • Daybreak
  • Midnight

Newly added variation

  • Yomogi
  • Hands
  • Platen
  • Twiggy
    • 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)

What is Style Book

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

theme.json

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.

theme.json (wp 6.2)

Added the ability to add sidebars in the editor

Added the sidebar display function in the following templates

  • category.html
  • tag.html
  • taxonomy.html
  • single.html
  • page.html

Sidebar installation guide

Tips

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.

  • 2col-has-widget-area.php
    • 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
  • example-archive.php
    • If you rename it to archive.php, the archive page will render using the PHP template instead of the archive.html template
  • example-page.php
    • By renaming it to page.php, the static page will display using the PHP template instead of the page.html template
  • example-single.php
    • 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

Display the is-tpl-single_template class in the body element。

When displaying an individual post page When a PHP template is used

Display the is-tpl-single-php class in the body element.

Example

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

BBPRESS Forum. with Classic template tag

詳細な情報

https://make.wordpress.org/core/tag/6-2+field-guide/