Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

i'm new to creating wordpress themes and want a menu at the Top of my page. I do have the following: Header.php

<html>
<head>
<title>Tutorial theme</title>
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>">
</head>
<body>
<div id="wrapper">
<?php wp_nav_menu( array('menu' =>'Top Navi', 'container' => '', 'items_wrap'  => '<ul id="menu-primary" class="menu" >%3$s</ul>'  ) ); ?>
<div id="header">
 </div>

functions.php

<?php
add_theme_support( 'menus' );
if (function_exists('register_nav_menus')) {
register_nav_menus(
    array(
        'main_nav' => 'Main Navigation Menu'
        )
    );
}
?>

And finally my css file http://pastebin.com/Pjr3THJm

However my menu comes out in a list, not horizontally. What am i doing wrong?

share|improve this question
1  
This is a CSS-specific question, not a WordPress question. (Side note: use theme_location rather than menu in your wp_nav_menu() call.) –  Chip Bennett Mar 11 '13 at 15:06
    
@ChipBennett Sorry about that then, was not aware it was an css specific issue –  Stingervz Mar 11 '13 at 15:08

1 Answer 1

up vote 1 down vote accepted

In my opinion, this is a CSS-only question.

You have to provide the <li> elements in your menu with the CSS style display: inline; (or 'inline-block').

share|improve this answer
    
I have no idea how to access the <li> elements as far as i can see i can only get to the <ul> element –  Stingervz Mar 11 '13 at 15:11
    
Found it! had to add #menu-primary li { display: inline; } to my css file. Thanks! –  Stingervz Mar 11 '13 at 15:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.