Title: Using wp_nav_menu()
Last modified: August 20, 2016

---

# Using wp_nav_menu()

 *  [bondbloke](https://wordpress.org/support/users/bondbloke/)
 * (@bondbloke)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/using-wp_nav_menu/)
 * I have worked out how to put wp_nav_menu() into its own container with a class,
   and how to give the
    “ul” element within this its own ID, now I can’t figure 
   out if there is a way that I can also do the same for the “li” elements of the
   list as well.
 * So far I have:-
 *     ```
       <?php
       wp_nav_menu(
                   array('primary',
                   'Primary Menu',
                   'container_class' => 'menu',
                   'menu_id' => 'menu_list'
                   )
       );
       ?>
       ```
   

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

 *  Moderator [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * (@keesiemeijer)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/using-wp_nav_menu/#post-2347435)
 * Try it with this: [http://codex.wordpress.org/Function_Reference/wp_nav_menu#Adding_Conditional_Classes_to_Menu_Items](http://codex.wordpress.org/Function_Reference/wp_nav_menu#Adding_Conditional_Classes_to_Menu_Items)
 *  Thread Starter [bondbloke](https://wordpress.org/support/users/bondbloke/)
 * (@bondbloke)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/using-wp_nav_menu/#post-2347457)
 * Interesing, but not quite sure how I would use it as I am only taking my first
   tentative steps in theme development…
 *  [Chip Bennett](https://wordpress.org/support/users/chipbennett/)
 * (@chipbennett)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/using-wp_nav_menu/#post-2347488)
 * Is there any particular reason you need to add a class to the list items?
 * If you’re after CSS targeting, just use:
 *     ```
       #menu_list li
       ```
   
 * If you need _less_ specificity, use:
 *     ```
       .menu li
       ```
   
 * If you need _more_ specificity, use both:
 *     ```
       .menu #menu_list li
       ```
   
 *  Thread Starter [bondbloke](https://wordpress.org/support/users/bondbloke/)
 * (@bondbloke)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/using-wp_nav_menu/#post-2347489)
 * You’re a genius Chip! That is the obvious solution, so b’y obvious that I didn’t
   even think of it… says he banging his head against the wall.

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

The topic ‘Using wp_nav_menu()’ is closed to new replies.

 * 4 replies
 * 3 participants
 * Last reply from: [bondbloke](https://wordpress.org/support/users/bondbloke/)
 * Last activity: [14 years, 7 months ago](https://wordpress.org/support/topic/using-wp_nav_menu/#post-2347489)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
