• Resolved dotzoki

    (@dotzoki)


    I have custom post type “thought”. I created menu with Thoughts item pointing to archive (https://site/thought). When I’m on archive the wp_nav_menu() knows (adds current-menu-item class) where I am. When I go to https://site/thought/somepost (so I’m on single-thought.php) it doesn’t add current-menu-item class to li item (Thoughts menu item) in navigation.

    Shouldn’t wp_nav_menu mark all subpages too ?

Viewing 1 replies (of 1 total)
  • Thread Starter dotzoki

    (@dotzoki)

    Well, found solution for it. For anyone with same problem the solution is posted here. Selected URI gets class parent_url, so use that in css style – but you can change the name of the class into whatever you wish.

    If there is better or official solution, please let me know.

Viewing 1 replies (of 1 total)
  • The topic ‘wp_nav_menu() – no current-menu-item on subpages’ is closed to new replies.