Please note, manual integration may no longer be required with the current version of Sahifa. Please test the standard automatic integration first, to see if you encounter residual styling with your setup
Sahifa creates significant residual styling as it wraps UberMenu inside its own menu system. To fix this, we’ll need to use Manual Integration to replace the theme’s menu system and prevent the theme from interfering.
Manual Integration
Always make changes in a child theme in order to preserve them when you update the theme
First, copy your theme’s header.php
into the child theme. Open the file up in the child theme and find the theme’s menu system. It looks like this (please note that this may change in the future, so be sure to base your code on the current header.php)
<?php $stick = ''; ?> <?php if( tie_get_option( 'stick_nav' ) ) $stick = ' class="fixed-enabled"' ?> <?php if(!tie_get_option( 'main_nav' )): ?> <?php //UberMenu Support $navID = 'main-nav'; if ( class_exists( 'UberMenu' ) ){ $uberMenus = get_option( 'wp-mega-menu-nav-locations' ); if( !empty($uberMenus) && is_array($uberMenus) && in_array("primary", $uberMenus)) $navID = 'main-nav-uber'; }?> <nav id="<?php echo $navID; ?>"<?php echo $stick; ?>> <div class="container"> <?php if( tie_get_option( 'nav_logo' ) ): ?> <a class="main-nav-logo" title="<?php bloginfo('name'); ?>" href="<?php echo home_url(); ?>/"> <img src="<?php echo tie_get_option( 'nav_logo' ) ?>" width="195" height="54" alt="<?php bloginfo('name'); ?>"> </a> <?php endif ?> <?php $orig_post = $post; wp_nav_menu( array( 'container_class' => 'main-menu', 'theme_location' => 'primary' , 'walker' => new tie_mega_menu_walker() ) ); $post = $orig_post; ?> <?php if(tie_get_option( 'random_article' )): ?> <a href="<?php echo home_url(); ?>/?tierand=1" class="random-article ttip" title="<?php _eti( 'Random Article' ) ?>"><i class="fa fa-random"></i></a> <?php endif ?> <?php if( tie_get_option( 'shopping_cart' ) && function_exists( 'is_woocommerce' ) ): global $woocommerce; ?> <a class="tie-cart ttip" href="<?php echo $woocommerce->cart->get_cart_url(); ?>" title="<?php _eti( 'View your shopping cart' ); ?>"><span class="shooping-count-outer"><?php if( isset( $woocommerce->cart->cart_contents_count ) && ( $woocommerce->cart->cart_contents_count != 0 ) ){ ?><span class="shooping-count"><?php echo $woocommerce->cart->cart_contents_count ?></span><?php } ?><i class="fa fa-shopping-cart"></i></span></a> <?php endif ?> </div> </nav><!-- .main-nav /--> <?php endif; ?>
We want to conditionally replace this with UberMenu as described in the Manual Integration guide, so we check for the existence of UberMenu, and print the line of UberMenu integration code, otherwise display the theme menu. We end up with this:
<?php if( function_exists( 'ubermenu' ) ): ?> <?php ubermenu( 'main' , array( 'theme_location' => 'primary' ) ); ?> <?php else: ?> <?php $stick = ''; ?> <?php if( tie_get_option( 'stick_nav' ) ) $stick = ' class="fixed-enabled"' ?> <?php if(!tie_get_option( 'main_nav' )): ?> <?php //UberMenu Support $navID = 'main-nav'; if ( class_exists( 'UberMenu' ) ){ $uberMenus = get_option( 'wp-mega-menu-nav-locations' ); if( !empty($uberMenus) && is_array($uberMenus) && in_array("primary", $uberMenus)) $navID = 'main-nav-uber'; }?> <nav id="<?php echo $navID; ?>"<?php echo $stick; ?>> <div class="container"> <?php if( tie_get_option( 'nav_logo' ) ): ?> <a class="main-nav-logo" title="<?php bloginfo('name'); ?>" href="<?php echo home_url(); ?>/"> <img src="<?php echo tie_get_option( 'nav_logo' ) ?>" width="195" height="54" alt="<?php bloginfo('name'); ?>"> </a> <?php endif ?> <?php $orig_post = $post; wp_nav_menu( array( 'container_class' => 'main-menu', 'theme_location' => 'primary' , 'walker' => new tie_mega_menu_walker() ) ); $post = $orig_post; ?> <?php if(tie_get_option( 'random_article' )): ?> <a href="<?php echo home_url(); ?>/?tierand=1" class="random-article ttip" title="<?php _eti( 'Random Article' ) ?>"><i class="fa fa-random"></i></a> <?php endif ?> <?php if( tie_get_option( 'shopping_cart' ) && function_exists( 'is_woocommerce' ) ): global $woocommerce; ?> <a class="tie-cart ttip" href="<?php echo $woocommerce->cart->get_cart_url(); ?>" title="<?php _eti( 'View your shopping cart' ); ?>"><span class="shooping-count-outer"><?php if( isset( $woocommerce->cart->cart_contents_count ) && ( $woocommerce->cart->cart_contents_count != 0 ) ){ ?><span class="shooping-count"><?php echo $woocommerce->cart->cart_contents_count ?></span><?php } ?><i class="fa fa-shopping-cart"></i></span></a> <?php endif ?> </div> </nav><!-- .main-nav /--> <?php endif; ?> <?php endif; ?>