• I’m using the child of twentyeleven.
    There is no problem creating any sidebar menu, but i would like to customize the horizontal menu in the header. Now it shows all the pages i have, but I need it to display only the pages i choose. In the widget page i can only customize sidebars menus, but not the upper one in the header. How can i do it?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter crowd

    (@crowd)

    alchymyth, thank you very much for the link, it helped.

    For those who might come across the same issue, let me show what i did:

    1. Add this code in functions.php

    function register_my_menus() {
      register_nav_menus(
        array( 'header-menu' => __( 'Header Menu' ) )
      );
    }
    add_action( 'init', 'register_my_menus' );

    2. In header.php find

    <?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?>

    and replace it with

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

    3. See Appearance >> Menus Theme Location box. The Header Menu drop-down should appear there.

    ??

    First up, never modify 2011, always use a child theme – https://vudu.me/child

    Next up, all you had to do was create a menu!!

    All you did above was create a new menu, and use it to replace the menu that already existed in 2011.

    In 2011, your pages are displayed by default. But all you had to do was create a custom menu and assign it in the menus interface, and it would have replaced the page listing! No need to creat a new menu.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Twentyeleven header menu’ is closed to new replies.