That’s normal because projects CPT posts are not child items of Projects page. Projects page is just to display project CPT posts.
Now how to highlight Projects page when viewing single project.
That’s where body classes comes handy. You can use body classes to highlight and unhighlight a menu item based on the page, cpt or section you are viewing.
For example if your post type is project and menu item id for Projects page is 26 and Blog page menu id is 27. Then you can highlight menu items like this.
body.single-project div.nav ul li#menu-item-26 > a{
border-bottom: 2px solid #fcbf32;
}
body.single-project div.nav ul li#menu-item-27 > a{
border-bottom: 0;
}
This will unhighlight blog menu item on projects single posts and highlight Projects page. You can apply same rules for other items too.
Related Posts:
- Adding a Custom Post Type into the menu screen
- Highlighting wp_nav_menu() Ancestor Class w/o Children in Nav Structure?
- Adding a menu item for a Custom Post Archive
- Adding custom post type archives to a WordPress menu
- Remove current_page_parent nav class from blog index when in CPT
- Creating “static” taxonomies to choose from, inside custom post type?
- Now can I group custom post types together?
- How to add meta box to backend menu page
- How can I get my Custom Post Types to appear in nav-menus.php ‘Menu’?
- Hide custom post type from nav menu manager
- wp_list_pages not showing cpt as I expected
- automatically placing custom post types singles into submenu of main nav menu
- Renaming Menu Item within Admin Menu Section for a Custom Post Type?
- How to Programically add to the new WordPress menus
- Menu with Automatic Pages Included from Custom Post Type
- Which User Role for Custom Post Type Menu – wp_nav
- Create Custom Post Type Archive Page with Sub Categories Navigation Sidebar
- Editor access to menu: custom post type missing
- Custom Post Type .current-menu-item not applying on Custom Post Type Archive Page
- Settings page above CPT page in admin section
- Remove current_page_parent from posts page link in WordPress nav menu
- Adding Custom Taxonomy Archive Link to Nav Menu Shows Up As (Invalid)
- Why are navigation items saved in the database?
- Menu highlight custom post type archive
- How do I create an archive page for standard posts?
- ‘Pages’ widget alternative for custom post types?
- Add the current menu item CSS class to a custom page type archive in WordPress menu
- current-menu-item class for custom post type parent
- How to change the admin menu “Pages” to something else
- Menu Multiple Taxonomies
- Navigation menus not showing because of custom post type filter
- Fake mark a menu item as current_page_item/active in WordPress
- Should I use custom menu, C.P.T. or theme options, or something else for this?
- Set menu active state for custom posttype and category, given custom taxonomy term
- Function to display custom post type on front page makes menu items dissapear
- Correct classes for WordPress menu items
- Customize the Dashboard Menu Editor
- How to make this menu drop down or like accordion
- Custom Post Types don’t highlight in menu nav
- Using default WP menu functionality to link to custom post-type listing?
- Second Set of Eyes: One custom taxonomy shows in Appearance > Menus, one does not
- page menu entry for custom post type
- How to display custom WP menus?
- Is there a way to establish parent/child relationship in WP menu links exclusively?
- Use custom walker to add taxonomy terms to main nav menu
- A page that shows a list of a specific custom post type
- Single custom post type’s menu ancestor/parent is Posts archive page
- menu link to custom post_type?
- Review site custom post type structure
- Custom Post Types in the WordPress Navigation Menu
- Custom Post Type & Custom Menu Walker to append custom class for active post types
- Including link to custom post type in ‘wp_list_pages’ function
- Which Template Page Should I Use?
- How can i automatically add CPT single pages as sub menu items
- How can I use archive-{post_type}.php theme template?
- Custom Post Type Link added to menu won’t show in frontend
- How To Display A List Of CPT Posts In A Meta Box On Menus Page?
- Get custom post type categories to show up in menus
- WordPress menu with custom taxonomy
- How to programmatically add elements in a custom menu
- Custom Posttype and menu classes
- highlight parent page menu item when in custom post type
- Custom post type post in custom menu
- Custom post type posts wont show in wp_nav_menu()
- Home page is getting current-menu-item even if it’s not home
- Menu for taxonomies and posts belongs to taxonomy
- How can I put content before my custom post type default pages?
- How we can create menu from Appearance > Menu and use as a add-submenu-page for admin menu?
- cpt not display inside nav menu
- How to create a Child & Siblings menu for a custom post type?
- wp_get_nav_menu_items doesn’t return custom post type item
- Automatically add CPT UI categories to the menu
- Custom post type category link + add to menu
- Possition a Custom Post Type Tab under Settings
- Navigation not working for custom post type pages
- wp_nav_menu doesn’t seem to work on custom post type pages
- how to display notifications in the wordpress menu when a new post is published
- Custom nav menu current item custom link problem
- Menu disappears with custom post type link
- Use the page picker from wordpress menu creation page
- How to display custom post type in a submenu?
- Custom Post Type parent slug as menu item
- add current-menu-item to multiple custom post types
- List all posts from custom post type by taxonomy
- Admin menu post type
- How to display the FAQ Archive page in my menu
- how to override menu widget?
- No Current Class showing in Menu for Custom Post Types
- Custom post type in submenu with custom meta box as a title with custom html
- CPT Archive with parent page
- Getting (Invalid) when adding custom taxonomy of custom post type link in menu [closed]
- Setting a Master Menu on a Custom Post Type
- Show posts of parent in edit.php
- current_page_item and custom post type?
- Menu that shows months and filters posts to show only posts from that month and shows posts as sub items
- Highlight specific menu item when custom post is page
- sidebar hierarchical menu category & custom post type
- Navigation won’t update to show full path to single post
- Menu Structure and URL structure, with Pages and Post-Type-Posts
- How to build help pages similar to WordPress Developer Resources