-1

I have installed burger theme and modified some template files to my needs. when I came to header, I decided to go with a simple bootstrap navigation bar, that doesn't require an extra menu. I took an example from getbootstrap.com and replaced ul>... with PHP script from original theme header.php adding bootstrap classes to ul element. My current code in header.php looks like this

<nav class="navbar navbar-default">
  <div class="container">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="#">Brand</a>
    </div>

    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">

      <?php $menu_args = array('theme_location'=>'primary',
                               'container'=>false,
                               'menu_class'=>'nav navbar-nav navbar-right main-menu');
          wp_nav_menu($menu_args);
      ?>
    </div><!-- /.navbar-collapse -->
  </div><!-- /.container-fluid -->
</nav>

The problem I am facing now is that when I narrow down the window I have my original menu accessible via a burger menu button from bootstrap and an extra burger menu above my whole navigation section, that I cannot figure out where is defined to appear and what files should I edit to disable it?

While researching into this problem, I saw how a lot of people end up using css display none to hide it, I am interested in completely removing it, so the server won't need to render extra html that will end up being hidden. Thank you

EDIT:

Here is a printscreen of what the rendered version looks like

enter image description here

Here's the rendered part of what you can see on the picture

...
</head>
<body class="home page page-id-15 page-template-default logged-in admin-bar custom-background customize-support">
<div class="slicknav_menu">
<a href="#" aria-haspopup="true" tabindex="0" class="slicknav_btn slicknav_collapsed" style="outline: none;">
<span class="slicknav_menutxt">Menu</span>
<span class="slicknav_icon">
<span class="slicknav_icon-bar"></span>
<span class="slicknav_icon-bar"></span>
<span class="slicknav_icon-bar"></span>
</span>
</a>
<ul class="slicknav_nav slicknav_hidden" style="display: none;" aria-hidden="true" role="menu"><li class="menu-item menu-item-type-post_type menu-item-object-page current-menu-item page_item page-item-15 current_page_item menu-item-29"><a title="Home page" href="http://localhost/site/" role="menuitem" tabindex="-1">Home</a></li>
<li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-32"><a href="/site/menu/main/" role="menuitem" tabindex="-1">Menu</a></li>
<li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-35"><a title="Contacts" href="http://localhost/site/contacts/" role="menuitem" tabindex="-1">Contacts</a></li>
</ul>
</div>

<div> address row </div>
<div> my navigation bar </div>
...

To provide more details here's the content of the top of the template file for this page

<?php get_header(); ?>

<!-- carusel section -->
<?php echo do_shortcode("[metaslider id=84]"); ?> 
...

the content of header.php I provided above

  • What do you want to disable? Please provide a screenshot and mark the thing that you want to remove. – 5ervant Aug 5 '15 at 15:04
  • the icon-bar markup makes the icon. It's hard to diagnose without seeing a rendered site as your markup is standard Bootstrap. – Aibrean Aug 5 '15 at 15:18
0

After more research and finally finding the answer, I was correct that there is no code in template php files that generates the menu. While looking into functions.php file I noticed that this theme connects jquery.slicknav.min.js to the page, when I looked into not minified version I figured out that this the code that generates the extra menu at the top of the page. To get rid of it I commented out the line that adds the js file and the line that adds css for the slick nav

//wp_enqueue_script('burger_slicknav',get_template_directory_uri().'/js/jquery.slicknav.min.js',array('jquery'),'',true);
//wp_enqueue_style( 'burger_slicknav',get_template_directory_uri().'/css/slicknav.css','','','all');

No I no longer have the extra menu displaying in on my website as well I do not have any extra code or requests for appropriate page load.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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