Tuesday, June 29, 2010

Highlighting in main Nav using is_page

<ul id="nav" role="navigation">    <li<?php if ( is_page('home')  )
{ echo ' class="current"'; } ?>><a href="/">Home</a></li>
<li<?php if ( is_page('about') ) { echo ' class="current"'; } ?>><a href="/about/">About</a></li>
<li<?php if ( is_page('work') ) { echo ' class="current"'; } ?>><a href="/work/">Work</a></li>
<li<?php if ( is_page('blog') ) { echo ' class="current"'; } ?>><a href="/blog/">Blog</a></li>
<li<?php if ( is_page('contact') ) { echo ' class="current"'; } ?>><a href="/contact/">Contact</a></li>
</ul>


<?php if (is_category('News')) : else :


if (is_page('Cakes') || is_category('')) {


echo 'id="selected"'


}


endif; ?>


No comments:

Post a Comment