I use Magento2 with sample data Luma theme and I applied a new custom theme Now I need to know the right way to add the navigation menu inside the header I want it between the logo and search box

3 Answers 3


You can try this,

You can move navigation menu using move element

add below lines to default.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout  /etc/page_configuration.xsd">
        <move element="catalog.topnav" destination="header-wrapper" />

This one works correct. Even this one did not break the mobile navigation and add after the logo.

<move element="navigation.sections" destination="header-wrapper" />
  • Works. Tested on 2.4.5-p1
    – puntable
    Mar 7, 2023 at 15:56

Try below code in default.xml layout file of your custom theme.

<move element="navigation.sections" destination="header.panel"/>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.