Forums

assigning a different class to sub-menus possibly via wp_nav_menu (1 post)

  1. Fotis K
    Member
    Posted 3 months ago #

    Should be easy, but I can't think of a way to do it:
    In a TwentyTen mod, I'm doing a check of whether the user is using a mobile browser or not. If the user is on a phone, I want the drop-down submenus that are hidden to be always on(since touch screens do not support hovering).
    In that case I'm trying to assign a new class called "mobile" to the items <ul class="sub-menu"> that wp_nav_menu() generated, but I don't know how...
    I thought this would work, but didn't:
    <?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary', 'items_wrap' => '<ul id="%1$s" class="mobile">%3$s</ul>' ) ); ?>
    any idea?

Reply

You must log in to post.

About this Topic