I created a navigation bar like tab system for my header and I can get all but my news button to highlight on that page. The news is a static page for all of my blog/news post.
Not sure if it's my code but if anyone has any ideas, much thanks to you.
<?php
$parent_title = get_the_title($post->post_parent);
?>
<?php
$items = wp_get_nav_menu_items("main-nav");
foreach($items as $item):
?>
<a <?php if($item->title == $parent_title){ echo 'class="active '.$parent_title.'"';}else{ echo 'class="'.$item->title.'"';} ?> href="<?php echo $item->url; ?>"><?php echo $item->title; ?></a>
<?php endforeach; ?>
wp_get_nav_menu_items()directly, instead of callingwp_nav_menu()and using the core-generated CSS classes? – Chip Bennett Mar 6 '12 at 19:54wp_nav_menu()(except for the generated<ul>and<li>tags of course - but then, those tags are semantically correct since you're outputting a list). – Chip Bennett Mar 6 '12 at 21:32