Title: Duplicated Mobile Nav Issue (code attached)
Last modified: August 31, 2016

---

# Duplicated Mobile Nav Issue (code attached)

 *  [heavypickle](https://wordpress.org/support/users/heavypickle/)
 * (@heavypickle)
 * [10 years ago](https://wordpress.org/support/topic/duplicated-mobile-nav-issue-code-attached/)
 * Thank you in advance for helping. Here’s the latest bug with a commercial theme:
 * The following code seems to be creating duplicate un-ordered lists in the theme’s
   mobile menu that are stacked one on top of each other identically. It’s as if
   there is some logic in the code that is causing this. I don’t even have the mobile
   menu selected under menu locations and duplicate menus show up on mobile devices.
   In fact, if I activate a footer menu for a footer menu location defined by the
   theme it will get appended to the mobile menu. In other words, if the menu exists
   and is selected for another location it will be appended to the mobile menu. 
   In some cases if a menu exists without being selected, the mobile nav will pick
   it up and also append it to the un-ordered list for the mobile nav despite non-
   selection in WordPress menus. I have traced the population of the page code from
   the following php code in the theme developer’s custom directory structure:
 *     ```
       <?php /**
       * The template for displaying mobile menu *
       * @package WordPress
       * @subpackage Mango
       * @since Mango 1.0
       */ ?>
       <?php
       global $mobile_menu,$mango_settings; $mobile_menu = false;
       if(has_nav_menu('mobile_menu')){ $menu_location = 'mobile_menu';
       $mobile_menu = true;
       } elseif(has_nav_menu('main_menu')){
       $menu_location = 'main_menu'; $mobile_menu = true;
       }
       if(has_nav_menu('primary_menu')){ $menu_location_pre = 'primary_menu'; $mobile_menu = true;
       }
       ?>
       <?php if ( $mobile_menu ) { ?>
       <div id="mobile-menu">
       <div id="mobile-menu-wrapper">
       <header>
       <?php _e("Navigation",'mango') ?>
       <a href="#" id="mobile-menu-close" title="Close Panel"></a>
       </header>
       <?php wp_nav_menu (
       array (
       'theme_location' => $menu_location, 'menu_class' => 'mobile-menu',
       'container' ) ); ?>
       => 'nav',
       'walker' => new mango_top_navwalker_mobile
       <?php
       if($mango_settings['mango_site_header'] ==22){
       wp_nav_menu ( array (
       ) ); }
       ?>
       <footer>
       <?php get_template_part("inc/social-icons"); ?>
       <p class="copyright"><?php echo htmlspecialchars_decode(esc_textarea($mango_settings['mango_copyright'])) ?></p>
       </footer> </div>
       <div id="mobile-menu-overlay"></div> </div>
       <?php } ?>
       'theme_location' => $menu_location_pre, 'menu_class' => 'mobile-menu', 'container' => 'nav',
       'walker' => new mango_top_navwalker_mobile
       ) ); }
       ?>
       <footer>
       <?php get_template_part("inc/social-icons"); ?>
       <p class="copyright"><?php echo htmlspecialchars_decode(esc_textarea($mango_settings['mango_copyright'])) ?></p>
       </footer> </div>
       <div id="mobile-menu-overlay"></div> </div>
       <?php } ?>
       ```
   
 * I already had to modify the theme’s style.css to eliminate a no reason bunch 
   copyright text at the bottom of the mobile menu by using the display: none; property
   selector. I would like to clean up remove the offending code as well but now 
   the priority is the duplicate lists in the mobile navigation menu.
 * The following code output is the result of the above php on the requested page:
 *     ```
       <div id="mobile-menu" class="opened">
               <div class="slimScrollDiv" style="position: relative; overflow: hidden; width: auto; height: 648px;"><div id="mobile-menu-wrapper" style="overflow: hidden; width: auto; height: 648px;">
                   <header>
                       Navigation                <a href="#" id="mobile-menu-close" title="Close Panel"></a>
                   </header>
                               <nav class="menu-amenu-main-navigation-container"><ul id="menu-amenu-main-navigation" class="mobile-menu"><li id="menu-item-8326" class="menu-item menu-item-type-post_type menu-item-object-page current-menu-item page_item page-item-8060 current_page_item"><a href="https://somecontent.com/">Home</a></li><li id="menu-item-8327" class="menu-item menu-item-type-post_type menu-item-object-page"><a href="https://somecontent.com/">somecontent™</a></li><li id="menu-item-8328" class="menu-item menu-item-type-post_type menu-item-object-page"><a href="https://somecontent.com/">somecontent</a></li><li id="menu-item-8329" class="menu-item menu-item-type-post_type menu-item-object-page"><a href="https://somecontent.com/">somecontent</a></li></ul></nav>								 <nav class="menu-amenu-main-navigation-container"><ul id="menu-amenu-main-navigation-1" class="mobile-menu"><li class="menu-item menu-item-type-post_type menu-item-object-page current-menu-item page_item page-item-8060 current_page_item"><a href="https://somecontent.com/">Home</a></li><li class="menu-item menu-item-type-post_type menu-item-object-page"><a href="https://somecontent.com/">"somecontent™</a></li><li class="menu-item menu-item-type-post_type menu-item-object-page"><a href="https://somecontent.com/">somecontent</a></li><li class="menu-item menu-item-type-post_type menu-item-object-page"><a href="https://somecontent.com/">somecontent</a></li></ul></nav>            <footer>
                       <div class="social-icons">
   
                   <a class="social-icon icon-facebook" href="https://www.facebook.com/somecontent" target="_blank">
                   <i class="fa fa-facebook"></i></a>
           </div>                <p class="somecontent">somecontent copyright text</p>
                   </footer>
               </div><div class="slimScrollBar" style="width: 4px; position: absolute; top: 0px; opacity: 0.2; display: none; border-radius: 7px; z-index: 99; right: 2px; height: 648px; background: rgb(255, 255, 255);"></div><div class="slimScrollRail" style="width: 4px; height: 100%; position: absolute; top: 0px; display: none; border-radius: 7px; opacity: 0.2; z-index: 90; right: 2px; background: rgb(51, 51, 51);"></div></div>
               <div id="mobile-menu-overlay"></div>
           </div>
       ```
   
 * I’d appreciate any direction on this.

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [lisa](https://wordpress.org/support/users/contentiskey/)
 * (@contentiskey)
 * [10 years ago](https://wordpress.org/support/topic/duplicated-mobile-nav-issue-code-attached/#post-7427071)
 * to get help from volunteers on the forum:
    which theme is in use? which plugins
   are in use? please provide link to your website.
 *  Thread Starter [heavypickle](https://wordpress.org/support/users/heavypickle/)
 * (@heavypickle)
 * [10 years ago](https://wordpress.org/support/topic/duplicated-mobile-nav-issue-code-attached/#post-7427163)
 * 1. The theme in use is: [http://themeforest.net/item/mango-responsive-woocommerce-theme/12522813](http://themeforest.net/item/mango-responsive-woocommerce-theme/12522813)
 * 2.Plugins in use:
    Ultimate Addons for Visual Composer by Brainstorm Force – 
   3.16.1 WooCommerce Social Login by WooThemes / SkyVerge – 1.7.5 Yoast SEO Premium
   by Team Yoast – 3.2.5 Contact Form 7 by Takayuki Miyoshi – 4.4.2 Duplicate Post
   by Enrico Battocchi – 2.6 Envato WordPress Toolkit by Envato – 1.7.3 Iconize 
   WordPress by Mladen Ivančević – 1.1.4 Quform by ThemeCatcher – 1.7.8 WPBakery
   Visual Composer by Michael M – WPBakery.com – 4.11.1 Loginizer by Raj Kothari–
   1.2.0 Mango Core by SW.THEMES – 2.0.6 Meta Box by Rilwis – 4.8.6 Popup Maker 
   by WP Popup Maker – 1.4.9 Regenerate Thumbnails by Alex Mills (Viper007Bond) –
   2.2.6 SG CachePress by SiteGround – 2.3.4 Simple Custom Post Order by Sameer 
   Humagain – 2.3 Simple Facebook Plugin by topdevs.net – 1.4 Subscribe2 by Matthew
   Robinson, Tanay Lakhani – 10.21 WooCommerce by WooThemes – 2.5.5 WP Construction
   Mode by SmartCat – 3.31 WP Font Awesome Share Icons by Spyros Vlachopoulos – 
   1.0.12 mySTAT by Smyshlaev Evgeniy – 3.5 YITH WooCommerce Ajax Product Filter
   by YITHEMES – 2.9.2 YITH WooCommerce Ajax Search by Yithemes – 1.3.9 YITH WooCommerce
   Compare by YITHEMES – 2.0.8 YITH WooCommerce Wishlist by YITHEMES – 2.0.15
 * 3. URL to site under development: `https://riaktor.com`
 * 4. Thank you.
 *  [Mark Ratledge](https://wordpress.org/support/users/songdogtech/)
 * (@songdogtech)
 * [10 years ago](https://wordpress.org/support/topic/duplicated-mobile-nav-issue-code-attached/#post-7427167)
 * Sorry, you’re using premium/paid themes and plugins which are not supported here.
   You need to go to the support sites where you bought the products for help with
   customizations and issues. You paid for support when you bought them, so you 
   should contact the people who sold them.
 * These forums are for free themes and plugins available from WordPress. See [http://codex.wordpress.org/Forum_Welcome#Commercial_Products](http://codex.wordpress.org/Forum_Welcome#Commercial_Products)

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Duplicated Mobile Nav Issue (code attached)’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 3 participants
 * Last reply from: [Mark Ratledge](https://wordpress.org/support/users/songdogtech/)
 * Last activity: [10 years ago](https://wordpress.org/support/topic/duplicated-mobile-nav-issue-code-attached/#post-7427167)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
