WordPress.org

Ready to get started?Download WordPress

Forums

Adding WP 3.0 menu to old theme (2 posts)

  1. lilblogger
    Member
    Posted 4 years ago #

    How do I enable / add the custom menu functionality to my existing WordPress theme?

    I'm using Grid Focus and my blog url is http://www.adventure-travel-reviews.com/.

    Specifically, I want to add custom menu functionality at the top right (where my About, Contact are now), and in my navigation bar (where I currently have my search box).

    Help? Thanks

  2. ericdaams
    Member
    Posted 4 years ago #

    The function to use is wp_nav_menu. For a basic implementation, this should work:

    1. First, enable theme support for navigation menus by adding this to functions.php:

    function your_function_name() {
    add_theme_support( 'menus' );
    }
    
    add_action( 'after_setup_theme', 'your_function_name' );

    2. Drop the following line into your header.php file where you want the menu to appear:

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

    Note the 'menu' => 'header' bit. This means that the name of the menu to be displayed here is header.

    3. Go to your admin area and select Appearance > Menus. Create a menu and call it Header. It should now appear in your theme.

    http://codex.wordpress.org/Function_Reference/wp_nav_menu

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.