Opened 8 years ago
Last modified 5 years ago
#38486 assigned defect (bug)
current_page_parent class wrongly added to menu item
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | 4.6.1 |
Component: | Menus | Keywords: | has-patch needs-unit-tests needs-testing |
Focuses: | Cc: |
Description
If the current page being viewed is either of the following:
- a custom post type archive
- a custom post type single item
a current_page_parent
class is added to the menu item assigned as the page_for_posts
.
I believe this is wrong because the page assigned as the page_for_posts
is associated with posts only. It has nothing to do with CPTs.
Attachments (2)
Change History (10)
#3
@
8 years ago
- Keywords has-patch added; needs-patch removed
@welcher sure!
Attached is 38486.diff, which will ensure the current_page_parent class doesn't get added to the static home page link if the query is for a custom post type single item or archive.
#4
@
8 years ago
I have the same issue. The patch from @henry.wright fixes that the current_page_parent
class is added incorrectly to the blog page menu item when viewing a CPT archive or single view. My patch 38486.2.diff goes further and adds the current_page_parent
class to the post type archive menu item if a single view of this CPT is displayed.
@welcher and/or @westonruter – could you take a look at the patch? Would be great to get a fix for that into core :)
#6
@
6 years ago
When will this be added into core? the issue is still a big problem, in 5.1.1, I'm right now trying to work a fix via CSS, but it's just not working well (I have two highlighted menu items, the CPT archive menu item, and the Blog item).
Thanks for the ticket! Would you like to create a patch?