This is a good practice to use if you have something added to your magento templates that require frequent updates, like a message on the header part of the website.
- Log into your Magento Admin panel and navigate to CMS -> Static Blocks
- Add new static block and remember to specify your Block Title and Block Identifier.
- Using your FTP client or any FileManager, navigate to app\design\frontend\default\themeXXX\template\page\html folder.
- Open the required phtml file using any text editor. E.g. header.ptml should you want to add this static block to header.
- Add below PHP code to the file.
- <?php echo $this->getLayout()->createBlock(‘cms/block’)->setBlockId(‘custom_block_id’)->toHtml() ?>
- save file, upload and refresh the website after clearing cache.