• I am sure this topic is somewhere in this forum, however, I am unable to locate. I simply would like to add multiple menus, but am having difficulty with the syntax. I attempted to use the following – which failed.

    if ( function_exists( 'wp_nav_menu' ) ){
    
    	if (function_exists('add_theme_support')) {
    
    		add_theme_support('nav-menus');
    
    		add_action( 'init', 'register_my_menus' );
    
    		function register_my_menus() {
    
    			register_nav_menus(
    
    				array(
    
    					'main-menu' => __( 'Main Menu' )
    					'utility-menu' => __( 'Utility navigation' )
    
    				)
    
    			);
    
    		}
    
    	}
    
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi:
    I’m a newbie so I maybe I’m wrong, but I was just asking about menus/navbars yesterday and here’s what I learned.

    WP 3.0 now has menu building capabilities accessible through the admin:
    Appearance > menus. It allows for multiple menus.

    I designed my own theme so I had to “enable” menus. What you might have right now is the message that your theme isn’t set up to work with the menus admin or words to that effect. That’s what I had.

    I followed the instructions from here:

    https://codex.www.ads-software.com/Navigation_Menus

    and added the code to my functions.php and to relevant templates.

    I’m building one main menu, then have a secondary menu for just blog related items (my site is a business site with a blog, not a blog with some static pages). So my second menu is going into a second sidebar just on blog related pages. I’ve used widgets for that menu and it’s interacting just fine with my main menu.

    Now I have to figure out the proper way to use the options IN the admin – menu, to style my navbar, but that’s another issue. I’ll be posting that question.

    Hope this gets you started!

    Oops, I was so happy to be able to help someone that I didn’t really read closely enough…

    It looks like you’re already aware of the menu functionality and are just trying to get the function to work.

    FWIW, here’s what I used:

    function register_my_menus() {
    register_nav_menus(
    array(
    'navbar-menu' => __( 'Navbar Menu' ),
    'blog-menu' => __( 'Blog Menu' ))
    );
    }
    
    add_action( 'init', 'register_my_menus' );

    Is that what you need?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Multiple custom menus – WP 3.0’ is closed to new replies.