Forum Home
Press F1
 
Thread ID: 96580 2009-01-15 08:19:00 CSS help Blam (54) Press F1
Post ID Timestamp Content User
738999 2009-01-15 08:19:00 My friend tom is having a CSS/PHP problem with his wordpress theme that neither me or himcan fix. He's trying to create a dynamic menubar, as demonstrated here: codex.wordpress.org . The only thing that doesn't work is the highlighting of the page that you're currently on. Here's his CSS:



#current{
text-color: #FFFFFF;
}

#navmenu ul{
float: center;
margin: 0 0 0 50px;
padding: 0;
list-style-type: none;
list-style-image: none;
}

#navmenu li{
display: inline;
font-family: Georgia, Sans-Serif;
font-size: 50px;
}

#navmenu ul li a {
font-family: Georgia, Sans-Serif;
font-size: 50px;
text-decoration: none;
margin: 4px;
padding: 5px 20px 5px 20px;
background: #393939
}

#navmenu ul li a:hover {
text-decoration: none;
margin: 4px;
padding: 5px 20px 5px 20px;
background: #292929;
}

and here's his PHP:


<div id="navmenu">

<ul>
<li<?php if (is_home()) {echo " id=\"current\"";} ?>>
<a href="<?php echo get_settings('home'); ?>">home</a></li>
<li>/</li>
<li<?php if (is_page('about') || is_single() && !in_category('2')) {echo " id=\"current\"";}?>>
<a href="?page_id=2/">about</a></li>
<li>/</li>
<li><img src="/images/header.png"></li>
<li<?php if (is_page('portfolio') || is_single() && !in_category('10')) {echo " id=\"current\"";}?>>
<a href="?page_id=10/">portfolio</a></li>
</ul>
</div>

can anyone spot a problem?

Cheers,
Blam&Tom
Blam (54)
739000 2009-01-15 09:34:00 I hope this will help you out

notice the bold codes




#navmenu ul li a#current {
color: #FFFFFF;
}

#navmenu ul{
float: center;
margin: 0 0 0 50px;
padding: 0;
list-style-type: none;
list-style-image: none;
}

#navmenu li{
display: inline;
font-family: Georgia, Sans-Serif;
font-size: 50px;
}

#navmenu ul li a {
font-family: Georgia, Sans-Serif;
font-size: 50px;
text-decoration: none;
margin: 4px;
padding: 5px 20px 5px 20px;
background: #393939
}

#navmenu ul li a:hover {
text-decoration: none;
margin: 4px;
padding: 5px 20px 5px 20px;
background: #292929;
}




<div id="navmenu">

<ul>
<li>
<a href="<?php echo get_settings('home'); ?>" <?php if (is_home()) {echo " id=\"current\"";} ?>>home</a></li>
<li> /</li>
<li>
<a href="?page_id=2/" <?php if (is_page('about') || is_single() && !in_category('2')) {echo " id=\"current\"";}?>>about</a></li>
<li> /</li>
<li> <img src="<?php bloginfo('template_url'); ?>/images/header.png"></li>
<li>
<a href="?page_id=10/" <?php if (is_page('portfolio') || is_single() && !in_category('10')) {echo " id=\"current\"";}?>>portfolio</a></li>
</ul>
</div>
cascade (12956)
739001 2009-01-15 10:34:00 This is Tom- thanks for your help cascade, the navbar now works :banana! in fact, have a :clap as well! Sel (14523)
739002 2009-01-15 19:02:00 np mate :) cascade (12956)
1