Bootstrap Navbar切换器和子菜单未在Wordpress网站中显示

时间:2019-06-27 14:18:13

标签: php wordpress twitter-bootstrap plugins navbar

我已经使用多合一迁移插件迁移了我的网站,一切似乎都很好,但是我的nabvar没有显示子菜单,并且在移动设备上也没有激活切换按钮。

  1. 我已经检查了页面是否存在
  2. 正确包含了库
  3. 在标签之前的页脚中,我调用了:
  4. 没有javascript错误
  5. 原始wordpress版本:5.0.2->迁移的wordpress版本:5.2.2

footer.php导入

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>

<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>

<?php wp_footer(); ?>
</body>

Header.php导入

<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">

NAVBAR CODE IN header.php

<div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button> 
                <a class="navbar-brand" href="#"><div class="hidden-md hidden-lg hidden-xl">
                        <span><img src="<?php echo get_template_directory_uri(); ?>/images/logo.gif" alt="" width="27px" /></span>
                        Snowbunnys
                    </div></a>
            </di>

<!-- Collect the nav links, forms, and other content for toggling -->
            <?php
            wp_nav_menu(array(
                'theme_location' => 'primary',
                'container' => 'div',
                'container_id' => 'bs-example-navbar-collapse-1',
                'container_class' => 'collapse navbar-collapse justify-content-end',
                'menu_id' => false,
                'menu_class' => 'nav navbar-nav',
                'depth' => 3,
                'fallback_cb' => 'wp_bootstrap_navwalker::fallback',
                'walker' => new wp_bootstrap_navwalker()
            ));
            ?> 

0 个答案:

没有答案