2015-10-07 44 views
0

在Wordpress菜單上工作:使用引導程序菜單得到包裹在Div - wordpress

我的ul li獲取包裹在UI中並創建Div。 截圖附: enter image description here

看來它會自動添加類菜單裏,並和阻止引導的風格和類

我的WP菜單功能:

/** 
* Get our wp_nav_menu() fallback, wp_page_menu(), to show a home link. 
*/ 
function register_my_menus() { 
    register_nav_menus(
    array(
     'header-menu' => __('Header Menu'), 
     'extra-menu' => __('Extra Menu') 
    ) 
); 
} 
add_action('init', 'register_my_menus'); 

回答

0

嘗試在主題模板改變導航菜單功能是這樣的:

<?php 

$defaults = array(
    'theme_location' => '', 
    'menu'   => '', 
    'container'  => '', // <- This empty = no container 
    '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); 

?> 

來源:https://codex.wordpress.org/Function_Reference/wp_nav_menu

查看默認數組的container索引。