• Paul Wright

    (@signyourbikeout)


    Hello,

    With WordPress 3 menus, I’m using wp_nav_menu instead of wp_list_pages. Most of the ‘highlight menu item for single pages’ tricks are built around the old wp_list_pages call.

    I want to make a filter to add ‘current-menu-item’ to the correct menu item on single pages. I looked in wp-includes/nav-menu-template.php: Do I attach to one of these areas:

    $items = apply_filters( 'wp_nav_menu_items', $items, $args );
    $items = apply_filters( "wp_nav_menu_{$menu->slug}_items", $items, $args );

    or is there a better way? Can you point me in the right direction?

    Thanks,

    Paul

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘filter wp_nav_menu to add current-menu-item for single.php’ is closed to new replies.