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 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' ) ); ?>

Or:

<?php
wp_nav_menu(
    array(
        '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

1 Answer 1

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. –  m0r7if3r Feb 19 '12 at 23:58
    
Kudos to the codex reference, I appreciate that. –  user13227 Feb 20 '12 at 3:45

Your Answer

 
discard

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