2012-09-25 133 views
0

我的WordPress功能如下,但每次添加子菜單時,都不會顯示爲應有的功能。WordPress下拉菜單問題

register_nav_menus(array(
    'primary' => __('primary-menu', 'Primary Menu'), 
)); 

回答

1

很難說什麼是錯的,沒有看到更多的代碼或網站網址。但是在functions.php和模板文件(如header.php)中檢查你的菜單調用和樣式表中的最小css。

沒有理由在WordPress中使用Superfish; WordPress 3 +菜單是純粹的CSS,不依賴於JavaScript,並且Superfish在四年內沒有更新。

這些是基本功能和css來自二十幾年;將它們用作您自己的代碼的基礎。

functons.php:

register_nav_menu('primary', __('Primary Menu', 'twentyeleven')); 

的header.php:

<?php wp_nav_menu(array('theme_location' => 'primary')); ?> 

的style.css:

#access { 
    background: #222; /* Show a solid color for older browsers */ 
    background: -moz-linear-gradient(#252525, #0a0a0a); 
    background: -o-linear-gradient(#252525, #0a0a0a); 
    background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#252525), to(#0a0a0a)); /* older webkit syntax */ 
    background: -webkit-linear-gradient(#252525, #0a0a0a); 
    -webkit-box-shadow: rgba(0, 0, 0, 0.4) 0px 1px 2px; 
    -moz-box-shadow: rgba(0, 0, 0, 0.4) 0px 1px 2px; 
    box-shadow: rgba(0, 0, 0, 0.4) 0px 1px 2px; 
    clear: both; 
    display: block; 
    float: left; 
    margin: 0 auto 6px; 
    width: 100%; 
} 
#access ul { 
    font-size: 13px; 
    list-style: none; 
    margin: 0 0 0 -0.8125em; 
    padding-left: 0; 
} 
#access li { 
    float: left; 
    position: relative; 
} 
#access a { 
    color: #eee; 
    display: block; 
    line-height: 3.333em; 
    padding: 0 1.2125em; 
    text-decoration: none; 
} 
#access ul ul { 
    -moz-box-shadow: 0 3px 3px rgba(0,0,0,0.2); 
    -webkit-box-shadow: 0 3px 3px rgba(0,0,0,0.2); 
    box-shadow: 0 3px 3px rgba(0,0,0,0.2); 
    display: none; 
    float: left; 
    margin: 0; 
    position: absolute; 
    top: 3.333em; 
    left: 0; 
    width: 188px; 
    z-index: 99999; 
} 
#access ul ul ul { 
    left: 100%; 
    top: 0; 
} 
#access ul ul a { 
    background: #f9f9f9; 
    border-bottom: 1px dotted #ddd; 
    color: #444; 
    font-size: 13px; 
    font-weight: normal; 
    height: auto; 
    line-height: 1.4em; 
    padding: 10px 10px; 
    width: 168px; 
} 
#access li:hover > a, 
#access ul ul :hover > a, 
#access a:focus { 
    background: #efefef; 
} 
#access li:hover > a, 
#access a:focus { 
    background: #f9f9f9; /* Show a solid color for older browsers */ 
    background: -moz-linear-gradient(#f9f9f9, #e5e5e5); 
    background: -o-linear-gradient(#f9f9f9, #e5e5e5); 
    background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#f9f9f9), to(#e5e5e5)); /* Older webkit syntax */ 
    background: -webkit-linear-gradient(#f9f9f9, #e5e5e5); 
    color: #373737; 
} 
#access ul li:hover > ul { 
    display: block; 
} 
#access .current-menu-item > a, 
#access .current-menu-ancestor > a, 
#access .current_page_item > a, 
#access .current_page_ancestor > a { 
    font-weight: bold; 
} 
0

子菜單將是一個CSS/jQuery的問題。

您是否自己編寫主題?這是可能的一個

parent:hover child.sub-menu { display: block; } 
/*Psuedo-code*/ 

類型的問題

+0

沒有理由在WordPress中使用快魚; WordPress 3 +菜單是純粹的CSS,不依賴於JavaScript,並且Superfish在四年內沒有更新。 – markratledge

+0

感謝您的注意 - 我會研究它。從答案中刪除 – Xhynk

+0

是的,我自己編寫了主題。 –