If this tutorial is not what you were looking for, you still have any questions, suggestions or concerns - feel free to let us know. Please help us to serve you better!

Your Name

Your Email

Your Message (required)

captcha

Featured templates

Magento. How to add a new static block to the header/footer section

In this tutorial you will learn how to add a static block to the header/footer section in Magento.

Magento. How to add a new static block to the header/footer section

  1. Log into your Magento Admin panel and navigate to CMS -> Static Blocks

    .

  2. Click on Add New Block button:

    magento_how_to_add_a_new_static_block_to_the_Header_Section_1

  3. Specify your Block Title and Block Identifier.

  4. Remember or copy your Identifier.

  5. Select the store view for which you want to add this Static block and alter the Content Field:

    magento_how_to_add_a_new_static_block_to_the_Header_Section_2

  6. Using your FTP client or any FileManager, navigate to app\design\frontend\default\themeXXX\template\page\html folder.

  7. Open header.phtml file using any text editor.

  8. Depending on where exactly you wish to place your Static Block, paste the following code:

    <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('custom_block_id')->toHtml() ?> 

    where custom_block_id is your identifier which you’ve indicated when creating the Static Block:

    magento_how_to_add_a_new_static_block_to_the_Header_Section_3

  9. Save this file and upload to the server.

  10. Reload your site to see the changes.

Thank you for reading this tutorial. Now you know how to add a static block to the header section in Magento.

Feel free to check the detailed video tutorial below:

Magento. How to add a new static block to the header/footer section