0

I am working on a 'from scratch' theme which has a simple wp_nav_menu call;

 wp_nav_menu(Array('menu_class' => 'nav', 'container' => FALSE)); 

On standard posts, archives and pages this produces the HTML I am expecting.

I have an issue when the active page/current menu item is a custom post type archive/single, wp_nav_menu generates the expected current-menu-item class for the active menu item, however it also generates a *current_page_parent* for the Blog link. The blog simply cannot be a page parent for a custom post type archive/single.

Some related images to help: http://bloke.org/uncategorized/untitled-post/

So how or why is this happening?

0

From look at core this is coming from this:

// back-compat with wp_page_menu: add "current_page_parent" to static home page link for any non-page query
if ( ! empty( $home_page_id ) && 'post_type' == $menu_item->type && empty( $wp_query->is_page ) && $home_page_id == $menu_item->object_id )
    $classes[] = 'current_page_parent';

It seems to be some legacy thing, I would just ignore it if you don't actually need it for some reason.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.