2017-07-07 179 views
0

我使用的引導步行者導航爲我的WordPress網站,但下拉列表顯示不WordPress的引導導航欄下拉菜單無法正常工作

//引導WP導航欄代碼

<div id="desktop-nav" class="header-nav-wrapper"> 
    <div id="" class="collapse navbar-collapse main-navbar-collapse"> 
     <?php 
       wp_nav_menu(array(
       'menu'    => 'header-menu-with-social-icons', 
       'theme_location' => 'header-menu-with-social-icons', 
       'depth'    => 0, 
       'container_id'  => 'bs-example-navbar-collapse-1', 
       'menu_class'  => 'nav navbar-nav', 
       'fallback_cb'  => 'wp_bootstrap_navwalker::fallback', 
       'walker'   => new wp_bootstrap_navwalker()) 
       ); 
     ?> 
    </div> 
</div> 

//function.php文件代碼

// Register Custom Navigation Walker 
require_once('wp-bootstrap-navwalker.php'); 

/************ Register Menus */ 
function register_menus() { 
    register_nav_menus(array(
     'header-menu' => 'header Menu', 
     'header-menu-with-social-icons' => __('header-menu-with-social-icons', 'THEMENAME'), 
     'footer-menu' => 'footer Menu' 
    )); 
} 
add_action('init', 'register_menus'); 

//引導

function foe_james_scripts() { 
// adding bootstrap 
    // Add Bootstrap Styles Custom Stylesheet and Bootstrap Scripts 
    wp_register_style('bootstrap-css', get_template_directory_uri() . '/css/bootstrap.min.css'); 
    wp_register_script('bootstrap-js', get_template_directory_uri() . '/js/bootstrap.min.js', array('jquery'), '3.3.4', true); 
    wp_enqueue_style('bootstrap-css'); 
    wp_enqueue_script('bootstrap-js'); 

    wp_enqueue_style('foe_james_a-style', get_stylesheet_uri()); 

    // wp_enqueue_script('foe_james_a-navigation', get_template_directory_uri() . '/js/navigation.js', array('jquery'), '20151215', true); 

    // wp_enqueue_script('foe_james_a-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array('jquery'), '20151215', true); 

// custom js 
    wp_register_script('home-page', get_template_directory_uri() . '/js/home.js', array('jquery'), '3.3.4', true); 
    wp_enqueue_script('home-page'); 

    // wp_register_script('menu-hover', get_template_directory_uri() . '/js/menu-hover.js', array('jquery'), '3.3.4', true); 
    // wp_enqueue_script('menu-hover'); 

    if (is_singular() && comments_open() && get_option('thread_comments')) { 
     wp_enqueue_script('comment-reply'); 
    } 
} 
add_action('wp_enqueue_scripts', 'foe_james_scripts'); 

請讓我知道,如果你能發現我過去幾個小時沒有的東西。

+0

你可以鏈接到你的網站或使用呈現的html/css/js的演示嗎? –

+0

當然。這裏是網站http://104.193.172.183/~jamesa/。子菜單是在「讚美」鏈接 –

+0

改變「恭維」鏈接到「」 –

回答

0

這是一個插件衝突。問題中顯示的代碼是正確的,不需要更正。只要刪除相沖突的插件即可。