I just updated a menu on a site of mine to utilize wp_nav_menu. Setting this up with WP was fairly straight forward however I've run into one small snag with the the way wordpress is outputting its parent/ancestor classes for use in highlighting the current page that the content belongs to, particularly with single post pages...
Highlighting the current page with
.current_page_item a and
.current_page_parent a works perfect as long as its just on a normal page with children, however as soon as you visit a post from events or media, the blog link in the menu is highlighted instead which is incorrect obviously.
*One thing noticeably wrong when looking at Wordpress' output is that the current page classes are not even being generated on the correct li tag that the post belongs to which seems to be the root of the problem.
For future reference, the Events, Media, & Blog pages all use a special query I've written to only grab the respective category for that page, ie.
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts("category_name=media&paged=$paged"); if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <div class="post"> </div> <?php endwhile; else: endif;
It should be noted: I have a secondary loop in the footer grabbing the latest blog post, dunno if this could be the culprit but Id like to keep that as is since it was placed there upon request of the client.
-- I take it back, I removed the secondary loop in the footer to see what would happen and the same results occurred so its not the problem as far as I can tell.
Hope thats enough info, if not let me know. Best, SB