• Resolved alfie

    (@drtanz)


    Im using the following code to call my menu in the theme:

    <?php wp_nav_menu( array( 'container' =>'','fallback_cb' => '', 'depth' => 1, 'theme_location' => 'primary-menu' ) ); ?>

    However it doesnt work as it is, only works if I remove the theme_location from the array. What am I doing wrong?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Have you registered that location in your theme?

    On a similar note, I am trying to get my nav menu to work but the menu_id is creating a ul thats blocking it form working.
    <?php wp_nav_menu( array(‘menu’ => ‘Main’, ‘container’ => ” , ‘menu_class’ => ‘Main’, ‘menu_id’ =>” )); ?>

    How do I get rid of or overrise that menu_id?

    @davidz.stein : Your question is only similar in that it relates to menus, the issues are quite different. Please start a new topic.

    Thread Starter alfie

    (@drtanz)

    yes i registered it in the functions file:

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

    Thread Starter alfie

    (@drtanz)

    i discovered the problem. If you have registered two menus and then only create one in wp-admin, it wont work. in my case i still had to crete my second menu so it wasnt working. then i created a test menu and assigned it to secondary menu position and everything worked fine.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Trouble with calling custom menu’ is closed to new replies.