I simply up-to-date a menu on the site of mine to make use of wordpress_nav_menu. Setting this track of Wordpress was fairly easy however I have encounter one small snag using the the way in which wordpress is outputting its parent/ancestor courses of instruction for use within highlighting the present page the content goes to, particularly with single publish pages...

Highlighting the present page with .current_page_item a and .current_page_parent a works perfect as lengthy since it's just on the normal page with children, however the moment you go to a publish from occasions or media, your blog link within the menu is outlined rather that is incorrect clearly.

*One factor noticeably wrong when searching at Wordpress' output would be that the current page courses are not really being produced around the correct li tag the publish goes that appears to become the main from the problem.

For future reference, the Occasions, Media, &lifier Blog pages all make use of a special query I have written to simply grab the particular category for your 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;

Hope thats enough info, otherwise tell me. Best, SB


EDIT - August 3, 2011


Below is really a screen shot of the items Im mentioning to when I only say that wordpress_nav_menu is producing the present classes around the wrong li tag. Outlined in Blue may be the food selection the publish really goes to. Hightlighted in Gray may be the incorrect li tag that wordpress has made the decision to include the present classes to rather.

Example http://img688.imageshack.us/img688/4180/picture2zo.png



EDIT - August 4, 2011


Maybe this helps demonstrate the way i possess the menu setup so far just a little better w/ Hadvig's assistance?

During my functions.php template I've -

<?php
// Add Custom Menu Support
if ( function_exists( 'register_nav_menu' ) ) {
    register_nav_menu( 'epr_menu', 'EPR Main Menu' );
}

function my_menu_items_hook($items, $menu, $args) {

  if ( 'epr_menu' == $menu->slug ) { // check if it is process your top menu
    if ( is_single() ) { // check if single post loaded

      if ( in_category('events') || in_category('media') ) {
        foreach ( $items as $key => $value ) {
          if ( 'blog' == $value->ID ) {
            $items[$key]->classes[] = array(); //unset classes for blog item
          }

          // add class if post from event category
          if ( in_category('events') && 'events' == $value->ID ) {
            $items[$key]->classes[] = 'current-menu-item';
          }

          // add class if post from media category
          if ( in_category('media') && 'media' == $value->ID ) {
            $items[$key]->classes[] = 'current-menu-item';
          }
        }
      }
    }
  }

  return $items;
}

add_action('wp_get_nav_menu_items', 'my_menu_items_hook', 10, 3);
?>

During my header.php template I am calling recption menus like so -

<div id="nav_wrapper">
    <ul id="nav">
        <?php wp_nav_menu( array( 'container' => '', 'items_wrap' => '%3$s' ) ); ?>
    </ul>
</div>