Maya Shop (YIT)

Knowledgebase Docs » UberMenu 3
USEFUL? 0
UberMenu 3

Maya Shop will interfere with the UberMenu functionality out of the box, so it’ll require a simple manual integration to set up

Manual integration

Always remember to make changes in a child theme so that they will be preserved when you update. Most premium themes offer a starter child theme that you can work with.

1. Install and activate a child theme

Maya Shop includes a starter child theme named maya-child

2. Copy the header.php file from the parent theme to the child theme

This file contains the menu code that we’ll be modifying.

3. Open the header.php in the child theme and find this code, which should be around line 239:

<!-- START NAV -->
<div id="nav" class="group">
    <?php
        $nav_args = array(
            'theme_location' => 'nav',
            'container' => 'none',
            'menu_class' => 'level-1',
            'depth' => apply_filters( 'yiw_main_menu_depth', 3),
            //'fallback_fb' => false,
            //'walker' => new description_walker()
        );

        wp_nav_menu( $nav_args );
    ?>
</div>
<!-- END NAV -->

4. Conditionally replace the theme’s menu code in the child theme header.php like this:


<?php if( function_exists( 'ubermenu' ) ): ?>
  <?php ubermenu( 'main' , array( 'theme_location' => 'nav' )); ?>
<?php else: ?>
  <!-- START NAV -->
  <div id="nav" class="group">
      <?php
          $nav_args = array(
              'theme_location' => 'nav',
              'container' => 'none',
              'menu_class' => 'level-1',
              'depth' => apply_filters( 'yiw_main_menu_depth', 3),
              //'fallback_fb' => false,
              //'walker' => new description_walker()
          );

          wp_nav_menu( $nav_args );
      ?>
  </div>
  <!-- END NAV -->
<?php endif; ?>

Now your menu is integrated without residual styling from the theme, allowing you to use UberMenu without interference.