Forums

Custom Menus, Can't get Theme Locations to show up in admin (6 posts)

  1. Stompit
    Member
    Posted 1 year ago #

    Hi Folks, I've followed about 5 tutorials very carefully but for the life of me can't figure out what is happening here, would be very grateful for some help :)

    I am creating a custom menu item, I have registered the menu in the functions.php as follows:

    if ( function_exists( 'register_nav_menu' ) ) {
    	register_nav_menu( 'main-menu', 'Main Menu' );
    }

    In my header.php I am using the following to call the menu:

    <?php wp_nav_menu( array( 'menu' => 'main-menu', 'container_class' => 'nav' ) ); ?>

    Yet when I go to the Appearance->Menus page in the admin the "Theme Locations" box is not there, the "Custom Links, Pages and Categories" boxes are blanked out with only the option to "Create Menu" on the right.

    It seems to be reading the functions.php file ok as I am NOT getting the warning message in the Appearance->Menus saying that there are no menus registered.

    Thanks Folks! :)

  2. Stompit
    Member
    Posted 1 year ago #

    Cummon, there must be something I've missed! :P

  3. Stompit
    Member
    Posted 1 year ago #

    No comments? :( This is a fresh WP 3.1 install with no plugins installed.

  4. Rev. Voodoo
    Volunteer Moderator
    Posted 1 year ago #

    <?php wp_nav_menu( array( 'theme_location' => 'main-menu', 'container_class' => 'nav' ) ); ?>
  5. Stompit
    Member
    Posted 1 year ago #

    Thanks for the input Voodoo, unfortunately the code you provided has no effect, Theme Locations box is still not appearing :(

    I probably should have mentioned in my first post; the wp_nav_menu call does populate with links, but seems to be reverting to a default behaviour of including all nav items (pages, posts etc), but as mentioned does not appear in the admin system so there is no way to manage.

    Thanks

  6. Stompit
    Member
    Posted 1 year ago #

    Ok, to close this thread I'll detail just how much of an idiot I actually am...

    The code I have used is only to create the custom menu locations, you then need to create instances of menus manually in the admin zone to assign to these locations.

    Once I created a menu in the admin system the locations I had created did in fact appear.

    Duu

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.