• Resolved dealwi8me

    (@dealwi8me)


    Hello,

    i need to add a menu in the top of the page above the header. This is what i did…
    header.php

    <body <?php body_class(); ?>>
    <div id="wrapper" class="hfeed">
    	<div id="header">
        <div id="upMenu">
    	<?php echo("Hello world")?>
        </div>
    		<div id="masthead">
    .....

    style.css –> added at the bottom

    #upMenu{
       height:30px;
      }

    I get the correct positions etc, but how can i add a menu that will be created by the administrator of the site instead of “hello world”?

    Thank you in advance.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Anonymous User 7658014

    (@anonymized_7658014)

    Do you mean something like wp_page_menu()?

    Second post on this page will get you on your way!

    Note:
    These tutorials use the best practice of a child theme, so the menu creation function is based on a parent theme and child theme.

    HTH

    David

    Thread Starter dealwi8me

    (@dealwi8me)

    I found the solution, i write it down perhaps someone else need it 🙂

    header.php

    <div id="upMenu">
    <?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'headerMenu' ) ); ?>
    </div>

    function.php (overrides)

    <?php
    // This theme uses wp_nav_menu() in one location.
    register_nav_menus( array(
      'primary' => __( 'Primary Navigation', 'twentyten' ),
      'headerMenu' => __( 'Header Menu', 'twentyten' ),
    ));
    ?>

    style.css

    #upMenu{
    	height:30px;
    }
    
    #upMenu ul{list-style-type:none;}
    #upMenu li {
    	float: right;
    	padding-right:.3em;
    	text-transform: uppercase;
    }
    #upMenu li a
    {
    color: #777;
    text-decoration: none;
    display: block;
    float: left;
    line-height: 200%;
    padding-top: .2em;
    padding-right: .5em;
    padding-bottom: 0.3em;
    padding-left: .5em;
    }
    
    #upMenu li a:hover {
    color: #333;
    }
    #upMenu li a.current{
    color: #FFF;
    background: #FFF top left repeat-x;
    padding: .5em 1.5em 0;
    }

    Thread Starter dealwi8me

    (@dealwi8me)

    Thanks guys for answering:)

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘TwentyTen overrides header.php’ is closed to new replies.