Ticket #12812: notice-and-styling-frontend-menus.12812.diff
File notice-and-styling-frontend-menus.12812.diff, 2.2 KB (added by , 15 years ago) |
---|
-
wp-includes/nav-menu-template.php
81 81 // Back compat classes for pages to match wp_page_menu() 82 82 $classes[] = 'page_item'; 83 83 $classes[] = 'page-item-' . $item->object_id; 84 if ( ! empty($item->classes) ) {84 if ( ! empty( $item->classes ) ) { 85 85 if ( in_array('current-menu-item', $classes) ) 86 86 $classes[] = 'current_page_item'; 87 87 if ( in_array('current-menu-parent', $classes) ) … … 361 361 362 362 // set parent's class 363 363 foreach ( (array) $menu_items as $key => $parent_item ) { 364 if ( 'post_type' == $parent_item->type && is_post_type_hierarchical( $queried_object->post_type ) && in_array( $parent_item->object_id, $queried_object->ancestors ) ) 365 $menu_items[$key]->classes = trim( $parent_item->classes . ' ' . 'current-' . $queried_object->post_type . '-ancestor' ); 364 if ( 365 isset( $parent_item->type ) && 366 'post_type' == $parent_item->type && 367 ! empty( $queried_object->post_type ) && 368 is_post_type_hierarchical( $queried_object->post_type ) && 369 in_array( $parent_item->object_id, $queried_object->ancestors ) 370 ) 371 $menu_items[$key]->classes = trim( $parent_item->classes . ' ' . 'current-' . $queried_object->post_type . '-ancestor current-menu-ancestor' ); 366 372 if ( in_array( $parent_item->db_id, $active_parent_item_ids ) ) 367 373 $menu_items[$key]->classes = trim( $parent_item->classes . ' ' . 'current-menu-parent' ); 368 374 if ( in_array( $parent_item->object_id, $active_parent_object_ids ) ) -
wp-content/themes/twentyten/style.css
431 431 display:block; 432 432 } 433 433 #access ul li.current_page_item a , 434 #access ul li.current-menu-item a { 434 #access ul li.current-menu-ancestor a, 435 #access ul li.current-menu-item a, 436 #access ul li.current-menu-parent a { 435 437 color: #fff; 436 438 } 437 439 … … 1340 1342 .home .sticky { 1341 1343 border: none; 1342 1344 } 1343 } 1344 No newline at end of file 1345 }