Customize secondary nav


Hi Fabio,

You can add HTML in your callback function as you want, so for example you can easily a wrapping div as follow:

function fabio_secondary_menu() {
 ?>
  <div class="example-class">
   <div class="tm-secondary-nav uk-container uk-container-center">
     <?php
     wp_nav_menu( array(
       'theme_location' => has_nav_menu( 'secondary' ) ? 'secondary' : '',
       'container'      => false,
        'beans_type'     => 'navbar',
     ) );
      ?>
    </div>
  </div>
  <?php
}

Note that I even moved the container in an HTML div in the example above which is not needed if you prefer to have it added in wp_nav_menu() as you did in your code snippet.

Happy coding,


Wow, thank you Thierry. I wish you and the community an Happy New Year 2017.


Thanks Fabio, happy new year to you too 🙂

Write a reply

Login or register to write a reply, it's free!