• Can anyone point me in the right direction to moving the menu in Twenty Eleven to above the header?

    I’m guessing I need to add something to my functions.php to remove ‘access’ from its current position, then hook it in again above the header?

    Up to now I’ve only worked with the Thematic theme. I thought I shd learn how to manipulate another theme.

    Any pointers appreciated!!!

Viewing 11 replies - 1 through 11 (of 11 total)
  • Are you editing Twenty Eleven directly, or are you using a child theme?

    You can move the menu by editing the header.php file, cut this code, starting on line #112:

    <nav id="access" role="navigation">
    				<h3 class="assistive-text"><?php _e( 'Main menu', 'twentyeleven' ); ?></h3>
    				<?php /*  Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff. */ ?>
    				<div class="skip-link"><a class="assistive-text" href="#content" title="<?php esc_attr_e( 'Skip to primary content', 'twentyeleven' ); ?>"><?php _e( 'Skip to primary content', 'twentyeleven' ); ?></a></div>
    				<div class="skip-link"><a class="assistive-text" href="#secondary" title="<?php esc_attr_e( 'Skip to secondary content', 'twentyeleven' ); ?>"><?php _e( 'Skip to secondary content', 'twentyeleven' ); ?></a></div>
    				<?php /* Our navigation menu.  If one isn't filled out, wp_nav_menu falls back to wp_page_menu. The menu assiged to the primary position is the one used. If none is assigned, the menu with the lowest ID is used. */ ?>
    				<?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?>
    			</nav><!-- #access -->

    And paste that after the header opening tag, on line #73. This will put the menu at the top of the header above the title, description, and header image.

    Thread Starter lmw

    (@lmw)

    Child theme…. always a child theme….

    Ah-ha! Thanks JLeuze. I had tried to move the contents of <nav> but I had moved it to the wrong place (not far enough up).

    Thanks again!

    You’re welcome!

    I am trying to follow the above instructions using a child theme.

    Do I simply copy and past the whole original Twentyeleven header.php file into the child theme folder and them make the amendment/rearrangement instructed above?

    I ask this because I have also read that the child theme file (in this case the child theme header.php) is only supposed to contain the parts to be amended. But in order to “rearrange” the code, will the whole original header php.file need to be reproduced?

    Thanks!

    simply copy and past the whole original Twentyeleven header.php file into the child theme folder and them make the amendment/rearrangement instructed above?

    yes

    have also read that the child theme file (in this case the child theme header.php) is only supposed to contain the parts to be amended

    this only applies definitively to functions.php and preferrably to style.css

    Hi, i found this post very useful… How would be the best practice to center the menu items? Instead of the default Left positioning?
    Thanks in advanced!

    i have a similar question
    i copied the menu above the image, but now the submenu is not realy working
    https://bpk-tagungszentrum.de
    [Login details redacted. NEVER post sensitive information on a public forum!]
    what can i do?
    best harry

    sorry – its the item über uns and Kontakt on the right hand side of the menu

    Please post your own topic.

    Musicalman

    (@musicalman)

    Thank you Josh, an old topic but just what I was looking for it worked a treat! ??

    @musicalman You’re welcome!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Twenty Eleven: Move menu to top’ is closed to new replies.