WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Hi I'm wanting to create a custom navigation menu that will require creating 2 div containers to hold the SUB-MENU set. In other words I want to do this:

<div id="access">
   <div class="menu">

      <ul class="parent">
            <div class="children-outer">
               <div class="children-inner">
                  <ul class="child">

   </div> <!--menu-->
 </div> <!--access-->

I'm doing this because I'm using about 3 different background images.

How would I go about adding this into the wp_nav_menu function? Do I add a filter in functions.php, or do I create a separate PHP file to do this?

Any helpful suggestions would be greatly appreciated.

share|improve this question

Register your menus in functions.php like so:

if ( function_exists( 'register_nav_menus' ) ) {
            'my_main_menu' => 'Main Menu: description',
            'my_sub_menu' => 'Sub Menu: description',
            'my_footer_menu' => 'Footer Menu: description'

Add the menu to the template like so:

<?php wp_nav_menu( array( 
    'sort_column' => 'menu_order', 
    'theme_location' => 'my_main_menu', 
    'container_class' => 'main-menu' 
); ?>

The function adds a container class, so you might want to consider trimming some of that markup.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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