In the home.html file of the twentytwentythree theme, the php code still seems to have an effect on the output:
<!-- wp:template-part {"slug":"header","tagName":"header"} /-->
<!-- wp:group {"tagName":"main","style":{"spacing":{"margin":{"top":"var:preset|spacing|50","bottom":"var:preset|spacing|70"}}},"layout":{"type":"constrained"}} -->
<main class="wp-block-group" style="margin-top:var(--wp--preset--spacing--50);margin-bottom:var(--wp--preset--spacing--70)">
<!-- wp:heading {"level":1,"align":"wide","style":{"spacing":{"margin":{"bottom":"var:preset|spacing|60"}}}} -->
<h1 class="alignwide" style="margin-bottom:var(--wp--preset--spacing--60)">Mindblown: a blog about philosophy.</h1>
<!-- /wp:heading -->
Is this standard practice?
>Solution :
Yes, this is standard practice in WordPress theme development. The home.html file you provided is likely a template file for the home page of a WordPress website using the TwentyTwentyThree theme. This template file is a mix of HTML and WordPress-specific syntax that is used by WordPress to generate the final HTML output.
The block is used to indicate a reusable template part that can be used in multiple templates, and the and blocks are used to define blocks in the WordPress block editor, which is a powerful feature that allows users to create and customize page layouts visually.
The var(–wp–preset–spacing–50) and var(–wp–preset–spacing–70) are CSS variables that are set by the theme’s PHP code. This allows the PHP code to dynamically set the values of these variables based on the theme’s settings, which can then be used in the HTML and CSS to ensure consistency throughout the website.
Overall, this is a common and recommended practice in WordPress theme development as it allows for greater flexibility and easier maintenance of the theme code.