1
0

Added "current" functionality to tabs and made Wordpress use same tabs.php file

This commit is contained in:
Aaron Lindsay 2011-03-20 20:46:21 -06:00
parent e2e9e81fd4
commit 12d663cba6
2 changed files with 14 additions and 16 deletions

View File

@ -23,17 +23,7 @@
<div id="header">
<div id="header-inner">
<div id="title"><a href="http://aclindsay.com">aclindsay.com</a></div>
<div id="tabs">
<ul>
<li><a href="http://aclindsay.com/home/">Home</a></li>
<li><a href="http://aclindsay.com/projects/">Projects</a></li>
<li><a href="http://aclindsay.com/about/">About</a></li>
<li><a href="http://aclindsay.com/resume/">Resume</a></li>
<li><a href="http://aclindsay.com/contact/">Contact</a></li>
</ul>
</div>
<?php include("/home1/aclindsa/public_html/tabs.php"); ?>
</div>
</div>

View File

@ -1,9 +1,17 @@
<div id="tabs">
<ul>
<li><a href="http://aclindsay.com/home/">Home</a></li>
<li><a href="http://aclindsay.com/projects/">Projects</a></li>
<li><a href="http://aclindsay.com/about/">About</a></li>
<li><a href="http://aclindsay.com/resume/">Resume</a></li>
<li><a href="http://aclindsay.com/contact/">Contact</a></li>
<?php
$tabs = array("Home" => "/home/",
"Projects" => "/projects/",
"About" => "/about/",
"Resume" => "/resume/",
"Contact" => "/contact/");
foreach ($tabs as $name => $url) {
if ($url == $_SERVER['REQUEST_URI'])
echo "<li><a href=\"http://aclindsay.com".$url."\" class=\"current\">".$name."</a></li>";
else
echo "<li><a href=\"http://aclindsay.com".$url."\">".$name."</a></li>";
}
?>
</ul>
</div>