Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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?

share|improve this question
1  
Your link 404s. –  vancoder Jun 28 '13 at 18:10
    
This appears to be the same issue, but the solution may be a hack: wordpress.org/support/topic/… –  vancoder Jun 28 '13 at 18:12
add comment

1 Answer

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.

share|improve this answer
    
Looks like vancoder's solution works. –  Kieran 'Kizbo' Barnes Jul 2 '13 at 12:59
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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