Magento 2 Luma Theme – How to Add Block to Header

luma-thememagento2

How can I add a block to the magento 2 luma header like in this image? I'm using M2.2 and app/design/frontend/magento directory is empty (i see that referenced a lot).

enter image description here

Best Answer

Add below code at after top.search referenceContainer:

app/code/design/frontend/[Package]/[Theme]/Magento_Search/layout/default.xml

    <referenceContainer name="header-wrapper">
        <block class="Magento\Cms\Block\Block" name="Promo">
            <arguments>
                <argument name="block_id" xsi:type="string">topPromo</argument>
            </arguments>
        </block>
    </referenceContainer>

Note: Need to change block id topPromo with your block Id and need some CSS for positioning.

Related Topic