Magento 2 – How to Call CMS Static Block in phtml file

In this post I am going to explain how to to call CMS static block in phtml file.

Use below code snippet to get CMS static block content in any template file.

echo $this->getLayout()
          ->createBlock('Magento\Cms\Block\Block')
          ->setBlockId('cms_static_block_identifier')
          ->toHtml();

Thats it. Enjoy Magento 2!!

1 Comment

  1. Thank you for the information you wrote.

Leave a Reply

Your email address will not be published. Required fields are marked *