WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Custom Menu help (2 posts)

  1. mrspabs
    Member
    Posted 1 year ago #

    I am having trouble getting the custom menus to work. the site is
    http://www.angela.haneestaging.com/

    Here is my functions.php

    <?php
    if ( function_exists('register_sidebar') )
    register_sidebar(array(
    'name' => 'homepage',
    'before_widget' => '<div class="widget">',
    'after_widget' => '</div>',
    'before_title' => '<h2>',
    'after_title' => '</h2>',
    ));
    
    if ( function_exists('register_sidebar') )
    register_sidebar(array(
    'name' => 'blog',
    'before_widget' => '<div class="widget">',
    'after_widget' => '</div>',
    'before_title' => '<h2>',
    'after_title' => '</h2>',
    ));
    
    add_theme_support( 'post-thumbnails' ); 
    
    function register_my_menus() {
      register_nav_menus(
        array(
          'header-menu' => __( 'Header Menu' ),
          'extra-menu' => __( 'Extra Menu' )
        )
      );
    }
    add_action( 'init', 'register_my_menus' );
    
    ?>

    here is my header.php

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    
    <head profile="http://gmpg.org/xfn/11">
    <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
    
    <title><?php wp_title(); ?></title>
    
    <meta name="generator" content="WordPress <?php bloginfo('version'); ?>" /> <!-- leave this for stats -->
    
    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
    <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />
    <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
    
    <?php wp_head(); ?>
    </head>
    <body>
    <div id="headerwrap">
    <div id="header">
    <div class="headerleft"><a href="<? bloginfo("url"); ?>"><img src="<?php bloginfo('template_directory') ?>/images/logo.png" class="logo" alt="<?php bloginfo('name'); ?>"></a></div>
    <div class="headerright"><?php wp_nav_menu( array( 'theme_location' => 'extra-menu', 'container_class' => 'my_extra_menu_class' ) ); ?>  <?php include (TEMPLATEPATH . '/searchform.php'); ?></div>
    </div>
    </div>
    <div id="navwrap">
    <div id="nav"><ul>
    <?php wp_nav_menu( array( 'theme_location' => 'header-menu' ) ); ?>
    </ul> </div>
    </div>
    <div id="wrapper">

    When I implement the above code, and go to Dashboard > Appearance > Menus it says:

    Your theme supports 0 menus. Select which menu appears in each location.

    The first menu ('header-menu') works, but the 'extra menu' doesn't appear.

    Help?

  2. mrspabs
    Member
    Posted 1 year ago #

    Please disregard, the above code is correct. The problem is that I was not ftping to the right location.

Topic Closed

This topic has been closed to new replies.

About this Topic