magento 2 static block in phtml code example
Example 1: magento2 add static block in phtml
<referenceBlock name="my-main-phtml-block"> <block class="Magento\Cms\Block\Block" name="my-main-phtml-block-cms"> <arguments> <argument name="block_id" xsi:type="string">my_cmsblock_identifier</argument> </arguments> </block></referenceBlock>
Example 2: magento2 add static block in phtml
<?= $block->getChildHtml('my-main-phtml-block-cms') ?>