2014-01-26 58 views
0

我的CSS是WordPress的導航子類siggning

<nav class="fluid topmenu"> 
     <ul class="fluid fluidList menuitems"> 
      <li><a href="index.html">HOME</a></li> 
       <li><a href="boxes.html">boxes</a> 
       <ul class="fluid fluidList submenu"> 
        <li><a href="small.html">small</a></li> 
        <li><a href="medium.html">MEDIUM</a></li> 
        <li><a href="large.html">large</a></li> 
       </ul> 
      </li> 
      <li><a href="aboutus.html">ABOUT US</a></li>    
     </ul> 
    </nav> 

我轉換這WordPress和把代碼

<nav class="fluid topmenu"> 
     <ul class="fluid fluidList menuitems"> 
     <li><?php wp_nav_menu(
       array(
        'theme_location' => 'main-menu', 
        'menu_class' => 'fluid fluidList submenu', 
        'container_id' => '', 
        )   
     );?> 
    </li> 

     </ul> 
    </nav> 

但在類子狀態並沒有應用到下拉子菜單在WordPress

我確實在functions.php中註冊了菜單,因爲我的主菜單正在工作

PLZ告訴我怎麼去應用到下拉類子菜單的wp_nav_menu submenuitems

回答

0

在nav元素補充一點:

<?php 

$defaults = array(
    'theme_location' => '', 
    'menu'   => '', 
    'container'  => 'div', 
    'container_class' => '', 
    'container_id' => '', 
    'menu_class'  => 'menu', 
    'menu_id'   => '', 
    'echo'   => true, 
    'fallback_cb'  => 'wp_page_menu', 
    'before'   => '', 
    'after'   => '', 
    'link_before'  => '', 
    'link_after'  => '', 
    'items_wrap'  => '<ul id="%1$s" class="%2$s">%3$s</ul>', 
    'depth'   => 0, 
    'walker'   => '' 
); 

wp_nav_menu($defaults); 

?> 

與類和和修改變量ID的

修改你需要的子類增加一個行者: wp_nav_menu change sub-menu class name?

+0

哪些變量shud IBE帶班改變....這是我在這個網站WordPress的轉換第一次嘗試了問這個傻問題 – user3117694

+0

@ user3117694您需要添加助行器改變的子菜單類非常抱歉: http://stackoverflow.com/questions/5034826/wp-nav-menu-change-sub-menu-class-name,但我會建議改變你的CSS的類名因爲它是easyer –

+0

thanx我得到它的工作walkermenu – user3117694

0
'主菜單', 'menu_class'=> '流體fluidList的菜單項', 'CONTAINER_ID'=> '', ) );?>

使用Jquery添加子類。

$(".menuitems li").find('ul').addClass('fluid fluidList submenu');