Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am wondering how instead of having the menuTab div come after the bones_main_nav function html code that is outputted to have it injected inside of it I suppose.

I have the following function

// the main menu
function bones_main_nav() {
    // display the wp3 menu if available
    wp_nav_menu(array(
        'container' => false,                           // remove nav container
        'container_class' => 'menu clearfix',           // class of container (should you choose to use it)
        'menu' => __( 'The Main Menu', 'bonestheme' ),  // nav name
        'menu_class' => 'nav top-nav clearfix',         // adding custom nav class
        'theme_location' => 'main-nav',                 // where it's located in the theme
        'before' => '',                                 // before the menu
        'after' => '',                                  // after the menu
        'link_before' => '',                            // before each link
        'link_after' => '',                             // after each link
        'depth' => 0,                                   // limit the depth of the nav
        'fallback_cb' => 'bones_main_nav_fallback'      // fallback function
    ));
} /* end bones main nav */

and the following html/php

<nav role="navigation">
                        <?php bones_main_nav(); ?>
                        <div id="menuTab">
                            <a href="#"><i class="icon-reorder"></i></a>d
                        </div>
                    </nav>

UPDATE the bones_main_nav function generates the following html, i have commented where I want the menutab div to go.

<div class="nav footer-nav clearfix">
<ul>
<li>home</li>
</ul>
<div id="menuTab"></div>**<!--THIS IS WHERE I WANT MENU TAB TO GO-->**
</div>
share|improve this question
    
It's hard to understand whay you mean by injected inside it, are you looking for 'menu_class' => 'nav top-nav clearfix menuTab', maybe? –  Wyck Jan 24 '13 at 6:17
    
@Wyck I added a better explanation in the update portion of the question. –  Anders Kitson Jan 24 '13 at 6:35

1 Answer 1

I don't think you can use that function and do that but I do not know anything about bones_main_nav . Using the default WordPress function ( which the bones function is wrapping) will only output <ul>...menu items... </ul>, then a simple way is to just wrap it in your template file.

For example:

 $defaults = (array(
        'container' => false,                          
        'menu' => __( 'The Main Menu', 'bonestheme' ),  // nav name
        'menu_class' => 'nav top-nav clearfix',         // adding custom nav class
        'theme_location' => 'main-nav',                 // where it's located in the theme
        'before' => '',                                 // before the menu
        'after' => '',                                  // after the menu
        'link_before' => '',                            // before each link
        'link_after' => '',                             // after each link
        'depth' => 0,                                   // limit the depth of the nav
        'fallback_cb' => 'bones_main_nav_fallback'      // fallback function
        ));

And your template markup would be:

<div class="nav footer-nav clearfix">
<?php wp_nav_menu( $defaults ); ?>
<div id="menuTab"></div>**<!--THIS IS WHERE I WANT MENU TAB TO GO-->**
</div>

A more complicated way via code would be to use a Menu Walker

share|improve this answer

Your Answer

 
discard

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.