:移除wp_nav_menu()多余的CSS选择器!这个不过多解释了,WP的MENU自带选择器实在是冗余,添加到主题的functions.php即可!
function uazoh_css_attributes_filter($var) {
return is_array($var) ? array() : '';
}
add_filter('nav_menu_css_class', 'uazoh_css_attributes_filter', 100, 1);
add_filter('nav_menu_item_id', 'uazoh_css_attributes_filter', 100, 1);
add_filter('page_css_class', 'uazoh_css_attributes_filter', 100, 1);