将此代码添加到functions.php
:
function hide_menu_items( $items ) {
if ( is_page( \'Enterprise\' ) ) { // You can use page ID, slug or title here
foreach ($items as $key => $item) if ( $item->title == "Blog" ) unset( $items[$key] );
}
return $items;
}
add_filter( \'wp_get_nav_menu_items\', \'hide_menu_items\', 20 );