直截了当:我从 WordPress 安装了212主题并更改了它的背景 + 删除了默认导航栏。(注释掉)现在我如何实现浮动在屏幕顶部的引导导航栏。这是导航栏代码:
<?php
if(!isset($nosession))
session_start();
}
/*if(isset($_COOKIE['username']))
{
$_SESSION['username'] = $_COOKIE['username'];
$_SESSION['loggedin'] = "true";
}*/
?>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="brand" href="#">IHES</a>
<div class="nav-collapse collapse">
<ul class="nav">
<li><a href="index.php">Home</a></li>
<li><a href="adopteren.php">Adopteren</a></li>
<li><a href="webshop.php">WebWinkel</a></li>
<li><a href="wallofsteen.php">Wall of Steen</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="icon-film" style="margin-top:-1px"></i> Videos <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="nieuws.php"><i class="icon-film"></i>Nieuws</a></li>
<li><a href="interviews.php"><i class="icon-film"></i>Interviews</a></li>
<li><a href="overig.php"><i class="icon-film"></i>Overig</a></li>
</ul>
</li>
<li><a href="#contact">Steenoloog Blog</a></li>
</ul>
<ul class="nav pull-right">
<?php
if(isset($_SESSION['loggedin'])){
if(isset($_COOKIE['cart']))
{
echo '
<li class="pull-right"><a href="shoppingcart.php"><i class="icon-shopping-cart icon-white"></i></a></li>
';
}
echo '<li class="navbar-form pull-right">
<a href="#">'.$_SESSION['username'].'</a>
</li>';
echo '<li class="navbar-form pull-right">
<a href="scripts/dologout.php" style="color: #FFF3F3;">Loguit</a>
</li>';
}else{
echo '<div class="navbar-form pull-right">
<a href="login.php"><button type="submit" class="btn">Login Pagina</button></a>
</div>';
}
?>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
</div>
那是我包含在每个 .php 页面顶部的导航栏代码。
require "navbar.php";
但是如何在 wordpress 的 2012 主题中使用它呢?我试图只使用 require 并从引导程序链接到 .css 文件。但这只会给我导航栏的内容。它缺少导航栏本身。(顺便说一句:我将代码粘贴在主题的header.php文件中)