• Hey everyone. Thanks for reading. I’m having an issue with WP Navigation Menus.

    tl;dr: my navigation menus, built in the admin panel, are working in my theme on my local machine but not on my remote installation.

    I recently put my WP site live here: https://www.i-am-matthew.com.

    I developed the site locally. When it came time to move it remotely I did a mass export from my local WP installation and imported it (pages, posts, comments, and menus) into my newly installed 3.2.1 remote WP. I then installed the theme I was developing.

    The problem is that my Navigational Menus administered through the admin panel are not functioning. The menu locations appear registered and I can assign menus to them in the admin panel, but they don’t generate on my website. wp_nav_menu seems to default to listing all of my Pages instead of using the menu specified by the theme_location argument. Not only this, but, wp_nav_menu doesn’t operate on any of the other fields given to it for styling.

    Here’s what’s in my functions.php:

    /****** MENUS ******/
    
    add_theme_support( 'menus' );
    
    function register_my_menus() {
     if ( function_exists( 'register_nav_menus' ) )
      register_nav_menus( array( 'main-nav' => 'MainNav', 'second-nav' => 'SecondNav') );
    }
    
    add_action( 'init', 'register_my_menus' );

    Here’s what’s in my theme:

    wp_nav_menu(
     array(
      'theme_location' => 'main-nav',
      'container' => 'div',
      'container_id' => 'menu',
      'before' => '<h1>',
      'after' => '</h1>'
    ));

    I believe I’ve followed all of the steps covered on WP’s Navigational Menus how-to, so I’m at a little bit of a loss.

    Any suggestions? Something happened between my local and my remote installs, since my menus still appear locally.

    Thanks in advance!

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Navigation Menu funct. broken’ is closed to new replies.