I want to create the custom header in Magento 1.9. I attached the screenshot of the header like this
I have tried the following code.
I have created the static block and static block calling in the header.phtml file
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('custom_block_id')->toHtml() ?>
but this code is not working .please suggest me
I have added this original header not working. Menu and logo not displaying.
<!--- custom header---->
<reference name="header">
<block type="page/header" name="header">
<action method="setTemplate"><template>page/html/customheader.phtml</template></action>
</block>
</reference>
<!--- original header---->
<reference name="header">
<!-- Search box wrapper -->
<block type="page/html_header" name="search_wrapper" template="page/html/search_wrapper.phtml">
<action method="insert">
<block>top.search</block>
</action>
</block>
Best Answer
Add the code bellow in :
app/design/frontend/{yourpackage}/{yourtheme}/layout/local.xml
Create your custom header in :
app/design/frontend/{yourpackage}/{yourtheme}/template/page/html/custom-header.phtml
Add
<?php echo $this->getChildHtml('custom.header'); ?>
inapp/design/frontend/{yourpackage}/{yourtheme}/template/page/html/header.phtml
Info : in
<block type="{block}/{type}"
if you haven't a custom block for your phtml, please put :<block type="core/template" ...
before="-"
to place it at the top of the header container.Update:
For a Static block:
in
local.xml
Then :
app/design/frontend/{yourpackage}/{yourtheme}/template/page/html/header.phtml
Add this :
<?php echo $this->getChildHtml('custom.header'); ?>