【发布时间】:2018-09-16 16:53:24
【问题描述】:
我正在尝试学习使用 Bootstrap 为 Wordpress 主题创建导航栏。我只想制作我的菜单而不使用 Navwalker。我使用了 W3 学校的一个简单的 Bootstrap 示例,但它不起作用。这是所需的导航栏。
想要的结果:
我的标题中有相同的代码。
<!doctype html>
<html <?php language_attributes();?>>
<head>
<meta charset="<?php bloginfo('charset'); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="<?php bloginfo('description'); ?>">
<title><?php bloginfo('name'); ?> |
<?php is_front_page() ? bloginfo('description') : wp_title(); ?>
</title>
<!-- Bootstrap core CSS -->
<link href="<?php bloginfo('template_url');?>/css/bootstrap.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="https://fonts.googleapis.com/css?family=Playfair+Display:700,900" rel="stylesheet">
<link href="<?php bloginfo('stylesheet_url')?>" rel="stylesheet">
<?php wp_head(); ?> <!-- This adds other information like plugins to the head -->
</head>
<body>
<div class="container">
<div class="row">
</div>
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">WebSiteName</a>
</div>
<ul class="nav navbar-nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="#">Page 1</a></li>
<li><a href="#">Page 2</a></li>
<li><a href="#">Page 3</a></li>
</ul>
</div>
</nav>
<div class="row">
hello world
</div>
</header>
这就是我的导航栏的样子
我的结果:
【问题讨论】:
标签: wordpress twitter-bootstrap-3 themes navbar