Today, I will guide you on how to call static block in file phtml. With static block, you can easy to edit, add new content for it.
First Step: Create new static block
Admin Panel > CONTENT > Elements > Blocks > Add New Block >
add information bellow for static block bellow and click Save button.
Enable Block: slect Enable (You can enable or disable block).
Block Title: Name of the block to easily identify the purpose of creating the block.
Identifier: Enter a unique block identifier(We usually use it to call static block).
Store View: Select the store views to show the static block in.
Block Content: Add content of the block.
Second Step: Call static block in phtml file
In before step, I have created a static block with identifier is magepow_block_identifier. I will call this static block to phtml file. Here is some ways to call it.
Call your static block in phtml file:
Display Static Block In CMS Page or Static Block:
Display CMS Static Block In XML:
Code to show the CMS Static Block in the “Content”
Or you can use xml and phtml to show static block:
Add this code to you file xml
display it in PHTML file with getChildHtml block method
Now, you can easy to edit that static block in the backend.