Separate classes/id's for each <li> within my Wordpress custom menu?

Discussion in 'WordPress' started by emmaburge, Jun 28, 2011.

  1. #1
    Hi all

    I'm working with this wordpress theme: http://www.cadengrant.me/wpthemes/?theme=PictureThis

    It uses custom menus to display the list items on the left of the screen, shown as the black 'tabs'.

    Here is the code:

    <div class="navigation">
    <?php if ( has_nav_menu( 'primary-menu' ) ) { /* if menu location 'primary-menu' exists then use custom menu */ ?>
    <?php wp_nav_menu( array( 'theme_location' => 'primary-menu', 'menu_class' => 'menu', 'container' => 'ul' ) ); ?>
    <?php } else { /* else use wp_list_pages */ ?>
    <ul class="menu">
    <?php wp_list_pages( array('title_li' => '')); ?>
    </ul>
    <?php } ?>
    </div>
    PHP:
    Can i ask – would it be possible to somehow assign a separate class to each of the navigation menu’s list items? perhaps some auto incrementing number for the class, that i’d include in my code with php?

    (I want to assign diff background images to diff list items is why i ask)

    Thanks v much in advance!!
     
    emmaburge, Jun 28, 2011 IP