我已经使用多合一迁移插件迁移了我的网站,一切似乎都很好,但是我的nabvar没有显示子菜单,并且在移动设备上也没有激活切换按钮。
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()
));
?>