这是header.php
的Y代码,但我无法理解为什么wp_nav_menu
会给我一个垂直菜单。
这是我的header.php
<div class="navbar-wrapper">
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<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="index.html"><img src="<?php bloginfo('stylesheet_directory'); ?>/assets/img/logo.png" alt="DevtechFreelancer"></a>
</div>
<?php
wp_nav_menu( array(
'theme_location' => 'primary',
'container' => 'nav',
'container_class' => 'navbar-collapse collapse',
'menu_class' => 'nav navbar-nav navbar-right'
) );
?>
</div>
</nav>
</div>
请帮助:我无法找到此错误的解决方案。
答案 0 :(得分:0)
这是解决方案
<?php
wp_nav_menu( array(
'theme_location' => 'primary',
'container' => 'ul',
'container_class' => 'navbar-collapse collapse',
'menu_class' => 'nav navbar-nav navbar-right'
) );
?>