I'm struggling to get a "current" class for the corresponding menu item when I'm on a singular (child) page of a custom post type. These are the arguments I used when registering the post type with register_post_type:
array(
'labels' => array(...),
'public' => true,
'has_archive' => true,
'capability_type' => 'post',
'hierarchical' => true,
'menu_position' => 5,
'supports' => array('title', 'editor', 'thumbnail'),
)
On the archive page everything is working fine and I do get the "current-menu-item" class for the current post types menu item. What can I do to make it work? I'm using wp_nav_menu(); to generate the menu.
.current-menu-item
. For hierarchical menu items, WordPress also outputs.current-{post_type}-parent
and.current-{post_type}-ancestor
. Can you provide a live link to the output?menu-item menu-item-type-custom menu-item-object-custom menu-item-92
when I'm on a singular page. Unfortunately I don't have a live link right now.