CPT Generated Page does not add `aria-current="page"` to navigation item

Support MB Custom Post Type CPT Generated Page does not add `aria-current="page"` to navigation item

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #45537
    F WF W
    Participant

    I am using Custom Post Type and it generates the page for the CPT automatically which is working fine. But there is some discrepancy between the auto generated page and manually created pages. When I am on a page, e.g. /about-us, the active "About Us" link in the WordPress navigation can be styled independently, because the <li> of the item gets a class of current-menu-item added and the <a> will be marked with aria-current="page".

    The auto generated page from CPT however does not do this. How I can make it behave correctly?

    Thanks in advance and best regards
    Fabian

    #45549
    PeterPeter
    Moderator

    Hello,

    It is the standard feature of WordPress itself. You can go to Appearance > Menus > Add a custom link menu with an absolute URL to the archive CPT page and check the current menu item again. Here is the screenshot https://imgur.com/vTpnF5G

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.