WordPress.org

Make WordPress Core

Ticket #13220: highlight_home_link.diff

File highlight_home_link.diff, 618 bytes (added by ptahdunbar, 4 years ago)

highlights the home link in nav menus

  • wp-includes/nav-menu-template.php

     
    7575                if ( 'custom' != $item->object ) 
    7676                        $classes[] = 'menu-item-object-'. $item->object; 
    7777 
    78                 if ( $item->object_id == $wp_query->get_queried_object_id() ) 
     78                if ( $item->object_id == $wp_query->get_queried_object_id() || ( 'custom' == $item->object && is_front_page() && !is_paged() ) ) 
    7979                        $classes[] = 'current-menu-item'; 
    8080 
    8181                // @todo add classes for parent/child relationships