Magento 2 Luma Theme – Header Customization Guide

magento2

Where is located the file of the header of luma theme ?

I want to add some text and facebook icon to header and I canĀ“t find where I do that !

Please Help !

Thanks

Best Answer

Create CMS static block(s) and add these in your theme default.xml file :

Step 1 :

in Admin go to

Content->Elements->Blocks

create CMS block there and add its identifier header-text-info and in Package/theme/Magento_Theme/lahyout/default.xml file add below code after tag :

Step 2:

<referenceContainer name="after.body.start">
    <container htmlClass="header-text" htmlTag="div" name="ship.notice.col-12">
        <block class="Magento\Cms\Block\Block" name="header.notice.text" before="-">
            <arguments>
                <argument name="block_id" xsi:type="string">header-text-info</argument>
            </arguments>
        </block>
    </container>
</referenceContainer>
  • And after that flush your cache,

    like that you can add header text or whatever info you want i.e facebook icon , phone number etc. This block will show at top of your site.