Forums

How do I add the option for more than 1 custom menu? (3 posts)

  1. dragonsjaw
    Member
    Posted 1 year ago #

    How do I add the option for more than 1 custom menu?
    I am using a child of twentyten:

    the functions file says -

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

    When I tried to add this code from Justin Tadlock, i get an error.

    add_action( 'init', 'register_my_menus' );
    
    function register_my_menus() {
    	register_nav_menus(
    		array(
    			'primary-menu' => __( 'Primary Menu' ),
    			'secondary-menu' => __( 'Secondary Menu' ),
    			'tertiary-menu' => __( 'Tertiary Menu' )
    		)
    	);
    }

    Please be specific.. and thank you.

  2. stevejohnson
    Member
    Posted 1 year ago #

    Would be helpful - if you want US to be specific in our answers - if you were more specific than, "i get an error". What error, when does it show up, etc.

  3. dragonsjaw
    Member
    Posted 1 year ago #

    Sorry it was a cannot redeclare error, didn't keep a copy.
    But I also realized I need to make a child functions.php file that only had the changes I wanted in it.
    I just can't figure out how to add another array.

    Too tired now will check back in the morning.

    I also noticed a real difference in load time using the new menu system, as I have one working... is that the problem? Should I dump the new menu and recreate the functions file with more than one and then set up the menu?

    thanks

Topic Closed

This topic has been closed to new replies.

About this Topic