[wp-trac] [WordPress Trac] #46787: Viewing single blog posts does not add class current_page_parent in navigation. Other issues with CPT.

WordPress Trac noreply at wordpress.org
Wed Apr 3 14:32:48 UTC 2019


#46787: Viewing single blog posts does not add class current_page_parent in
navigation. Other issues with CPT.
--------------------------+-----------------------------
 Reporter:  leec87        |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Menus         |    Version:  5.1
 Severity:  major         |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 The main issue I'm reporting is that when adding a menu navigation item of
 a Page that is set to be the page for blog posts, when viewing that page
 the menu item is corrected hightlighted as active.

 However, when viewing single blog posts, the menu item should have the
 current_page_parent class added to it, but it does not. The parent 'Blog'
 menu item (as titled in my case) should be hightlighted whenever single
 blog posts are being viewed, not just the index page.

 Similarlialy, I have created a custom post type and have an archive page,
 which also has a menu item. When viewing the archive page of this CPT, the
 menu item has current-menu-item added to it, but when viewing a post
 inside this, the current_page_parent class should be added to this menu
 item, but it isn't, leaving no highlighted menu item in the navigation.

 This was reported years ago, but was marked as fixed, with no real fix for
 the issue, so I'm re-opening it. There are countless comments and posts
 online regarding this issue that has always been around. I can only gather
 it must be difficult to fix, but either way, it still is yet to be
 resolved.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/46787>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list