HI Guys, I am just working on a few tweaks to a theme and have hit a small problem with the navigation. As you can see here: http:guitarheroplus.com when home is selected the tab in the navigation will not display as blue (current) tab whereas the others will. My code in header php to call the navigation in is: <div id="navi"> <ul id="nav"> <li class="page_item"> <a href="<?php echo get_settings('home'); ?>/" title="Home">Home</a> </li> <?php $pages = wp_list_pages('sort_column=menu_order&depth=1&title_li=&echo=0'); print_r($pages); ?> </ul> </div> And the style is: #navi { position:relative; height: 25px; width: 901px; margin: 0px auto; top: 60px; text-align: center; line-height: normal; } #nav { list-style: none; margin: 0 1px; padding: 0px; float: left; clear:both; } #nav li { float: left; height: 25px; background: url(images/navtabr.gif) top right no-repeat; margin: 0 1px; white-space: nowrap; } #nav .page_item a{ color: #white; display: block; background: url(images/navtabl.gif) top left no-repeat; text-decoration: none; padding: 0px 10px 0px 10px; line-height: 25px; } #nav li:hover { background-position: 100% -36px; } #nav .page_item a:hover { background-position: 0px -36px; border: none; } #nav li.current_page_item { color: white; text-decoration: none; background: url(images/navtabactiver.gif) top right no-repeat; } #nav .current_page_item a, #nav .current_page_item a:visited{ color: white; text-decoration: none; background: url(images/navtabactivel.gif) top left no-repeat; } If anyone has any idea how I would get the Home tab to display in blue when it is the current item I would appreciate the help a lot. Cheers, Forest.
replace this line <li class="page_item"> PHP: with this <li class="page_item <?php if ( is_home()) echo 'current_page_item'; ?>"> PHP:
Nice bit of code there. I think is_home() checks if this current page is the home page. If that evaluates to true it adds the 'current_page_item' class to your link.