我还没有找到解决这个问题的简单方法。我想在bootstrap 3中的固定顶部导航栏菜单上方添加一个简单的黑条菜单。
这是当前标题HTML:
<header>
<?php responsive_in_header(); // header hook ?>
<div class="navbar navbar-default navbar-fixed-top">
<div class="container">
<!-- .navbar-toggle is used as the toggle for collapsed navbar content -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-responsive-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<?php if( bi_get_data('custom_logo') !== '' ) { ?>
<div id="logo"><a href="<?php echo home_url(); ?>/" title="<?php bloginfo( 'name' ); ?>" rel="home">
<img src="<?php echo bi_get_data('custom_logo'); ?>" alt="<?php bloginfo( 'name' ) ?>" />
</a></div>
<?php } else { ?>
<?php if (is_front_page()) { ?>
<a class="navbar-brand" href="<?php bloginfo( 'url' ) ?>/" title="<?php bloginfo( 'name' ) ?>" rel="homepage"><b><?php bloginfo( 'name' ) ?></b></a>
<?php } else { ?>
<a class="navbar-brand" href="<?php bloginfo( 'url' ) ?>/" title="<?php bloginfo( 'name' ) ?>" rel="homepage"><b><?php bloginfo( 'name' ) ?></b></a><a href="http://www.bootstrap.com">click</a>
<?php } } ?>
</div>
<div class="navbar-collapse collapse navbar-responsive-collapse">
<?php
$args = array(
'theme_location' => 'top-bar',
'depth' => 2,
'container' => false,
'menu_class' => 'nav navbar-nav',
'walker' => new Bootstrap_Walker_Nav_Menu()
);
wp_nav_menu($args);
?>
</div>
</div>
</div>
</nav>
</header><!-- end of header -->
以下是标题中固定导航上方的导航:
<nav class="utility-nav navbar navbar-inverse navbar-static-top">
<div class="container">
<ul class="nav navbar-nav navbar-right">
<li class="dropdown partners">
<a class="dropdown-toggle" data-toggle="dropdown">
Partner
<b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li><a href="/colleges">Colleges</a></li>
<li><a href="/trainers">Personal Trainers</a></li>
<li><a href="/employers">Employers</a></li>
<li><a href="/healthclubs">Health Clubs</a></li>
<li><a href="/supplement">Supplement Companies</a></li>
<li><a href="/supplement-reps">Supplement Representatives</a></li>
</ul>
</li>
<li><a href="/blog/">Blog</a></li>
<li><a href="/support/">Support</a></li>
</ul>
</div>
</nav>