WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm creating a theme from a template based on Wordpress 3.0. I've started with items like Starkers which is a completely bare theme, and even tried modifying something by default like Twenty Ten or Eleven. However, the thing that gets me is how can I adjust the css to covert a single line of PHP such as (used as default now for navigation):

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


        'container_class' => 'menu-header',
        'theme_location'  => 'primary'

Into a stylized list element that can be adjusted to the length of the entire navigation menu?

I'm not understanding how the PHP is turned into the right amount of <li>'s (which is the case in the generated html viewable in Firebug or another inspector) where I can modify them how I wish.

share|improve this question
up vote 0 down vote accepted

wp_nav_menu() pulls from the menus selected/generated in Appearance -> Menus. There will be one <li> for each item in the menu you select.

share|improve this answer
Thanks @m0r7if3r Is this a function that is default for Wordpress? I was trying to find how it parses this through the functions.php page but couldn't really see anything. Happen to know where this functionality is built in? (I like to learn how stuff works - and this just threw me for a loop) – user13227 Feb 19 '12 at 22:30
wp_nav_menu() is a function built into wordpress. If you haven't yet, you should check out what the codex has to say. – mor7ifer Feb 19 '12 at 23:58
Kudos to the codex reference, I appreciate that. – user13227 Feb 20 '12 at 3:45

Your Answer


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