• I have downloaded a good theme that I like (“smartone” is the name of the theme). It has one built in menu that I can setup in the admin area. I was wondering how I would go about adding a second built in menu that I can control through the admin area.

    Any ideas and thank you for your help.

Viewing 1 replies (of 1 total)
  • Adding a menu location is pretty easy:

    1) Register the new Nav Menu, using the theme_location argument, via register_nav_menus() in “functions.php”.

    2) Call wp_nav_menu(), using the same theme_location argument, in the appropriate Theme template file.

    For the SmartOne Theme:

    1) Look for this line in “functions.php”:

    // This theme uses wp_nav_menu() in one location.
    register_nav_menus( array(
    	'primary' => __( 'Primary Navigation', 'smartone' ),
    ) );

    And change it to this:

    // This theme uses wp_nav_menu() in one location.
    register_nav_menus( array(
    	'primary' => __( 'Primary Navigation', 'smartone' ),
    	'secondary' => __( 'Secondary Navigation', 'smartone' )
    ) );

    (Your new theme_location is secondary.)

    2) Wherever you want this second menu to appear, add the following (assuming you want the same styling as the “primary” menu):

    <?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'secondary', 'link_before' => '<span class="item-left"></span><span class="icon">' , 'link_after' => '</span><span class="item-right"></span>' ) ); ?>

Viewing 1 replies (of 1 total)
  • The topic ‘Adding a second menu array to a theme.’ is closed to new replies.