I am new in magento 2. i am facing a problem with default top-menu block. I create a custom header and i want to move top-menu block in my custom header. But not get success Code:
Custom header file :
<div class="header"> <?php //echo $this->getChildHtml("logo"); ?>
<div class="container">
<div class="nav-top">
<?php echo $this->getChildHtml("catalogTopnav"); ?>
</div>
</div>
</div>
layout/default.xml
<referenceContainer name="header.container">
<block class="Magento\Framework\View\Element\Template"
name="custom_header" as="custom_header"
template="Magento_Theme::html/customheader.phtml" before="-" /></referenceContainer>
<move element="catalog.topnav" destination="custom_header" after="logo" />
Please help me any one how to print top menu item in my custom header. thanks in advance