How to style the menu?
-
Hello,
I’m using the new menu in WP 3.0 and includes it into my theme this way:
<?php wp_nav_menu( array( ‘container_class’ => ‘menu-header’, ‘theme_location’ => ‘primary’ ) ); ?>It’s a horizontal top menu. Each li-element must have a different background-color. The HTML looks like this:
<ul id="menu-menu" class="menu"> <li id="menu-item-6" class="menu-item menu-item-type-taxonomy current-menu-item current-category-ancestor menu-item-6"><a href="#">Item1</a></li> <li id="menu-item-4" class="menu-item menu-item-type-post_type menu-item-4"><a href="#">Item2</a></li> <li id="menu-item-13" class="menu-item menu-item-type-post_type menu-item-13"><a href="#">Item3</a></li> </ul>
I was hoping that the first li-element got a class like menu-item-1, the next li-element menu-item-2 and so on. In that way, I could change the CSS for the different items. But instead the post/page id is used instead. Is there a way to do so or should I use jQuery?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘How to style the menu?’ is closed to new replies.